[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [3093] Refactoring: file open modes now have a shorter
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [3093] Refactoring: file open modes now have a shorter name. |
Date: |
Fri, 22 May 2009 22:00:29 +0000 |
Revision: 3093
http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3093
Author: gscrivano
Date: 2009-05-22 22:00:24 +0000 (Fri, 22 May 2009)
Log Message:
-----------
Refactoring: file open modes now have a shorter name.
Modified Paths:
--------------
trunk/myserver/include/base/file/file.h
trunk/myserver/src/base/file/file.cpp
trunk/myserver/src/base/file/files_utility.cpp
trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
trunk/myserver/src/base/files_cache/cached_file_factory.cpp
trunk/myserver/src/base/home_dir/home_dir.cpp
trunk/myserver/src/conf/security/security_cache.cpp
trunk/myserver/src/http_handler/cgi/cgi.cpp
trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp
trunk/myserver/src/http_handler/http_file/http_file.cpp
trunk/myserver/src/http_handler/scgi/scgi.cpp
trunk/myserver/src/http_handler/wincgi/wincgi.cpp
trunk/myserver/src/log/stream/file_stream.cpp
trunk/myserver/src/protocol/control/control_protocol.cpp
trunk/myserver/src/protocol/ftp/ftp.cpp
trunk/myserver/src/protocol/http/http_data_read.cpp
trunk/myserver/src/server/server.cpp
trunk/myserver/tests/test_file.cpp
trunk/myserver/tests/test_ssl_socket.cpp
Modified: trunk/myserver/include/base/file/file.h
===================================================================
--- trunk/myserver/include/base/file/file.h 2009-05-22 22:00:04 UTC (rev
3092)
+++ trunk/myserver/include/base/file/file.h 2009-05-22 22:00:24 UTC (rev
3093)
@@ -31,15 +31,15 @@
class File : public Stream
{
public:
- static const u_long MYSERVER_OPEN_READ;
- static const u_long MYSERVER_OPEN_WRITE;
- static const u_long MYSERVER_OPEN_TEMPORARY;
- static const u_long MYSERVER_OPEN_HIDDEN;
- static const u_long MYSERVER_OPEN_ALWAYS;
- static const u_long MYSERVER_OPEN_IFEXISTS;
- static const u_long MYSERVER_OPEN_APPEND;
- static const u_long MYSERVER_CREATE_ALWAYS;
- static const u_long MYSERVER_NO_INHERIT;
+ static const u_long READ;
+ static const u_long WRITE;
+ static const u_long TEMPORARY;
+ static const u_long HIDDEN;
+ static const u_long OPEN_ALWAYS;
+ static const u_long OPEN_IF_EXISTS;
+ static const u_long APPEND;
+ static const u_long CREATE_ALWAYS;
+ static const u_long NO_INHERIT;
File();
File(char *,int);
Modified: trunk/myserver/src/base/file/file.cpp
===================================================================
--- trunk/myserver/src/base/file/file.cpp 2009-05-22 22:00:04 UTC (rev
3092)
+++ trunk/myserver/src/base/file/file.cpp 2009-05-22 22:00:24 UTC (rev
3093)
@@ -54,15 +54,15 @@
using namespace std;
-const u_long File::MYSERVER_OPEN_READ = (1<<0);
-const u_long File::MYSERVER_OPEN_WRITE = (1<<1);
-const u_long File::MYSERVER_OPEN_TEMPORARY = (1<<2);
-const u_long File::MYSERVER_OPEN_HIDDEN = (1<<3);
-const u_long File::MYSERVER_OPEN_ALWAYS = (1<<4);
-const u_long File::MYSERVER_OPEN_IFEXISTS = (1<<5);
-const u_long File::MYSERVER_OPEN_APPEND = (1<<6);
-const u_long File::MYSERVER_CREATE_ALWAYS = (1<<7);
-const u_long File::MYSERVER_NO_INHERIT = (1<<8);
+const u_long File::READ = (1<<0);
+const u_long File::WRITE = (1<<1);
+const u_long File::TEMPORARY = (1<<2);
+const u_long File::HIDDEN = (1<<3);
+const u_long File::OPEN_ALWAYS = (1<<4);
+const u_long File::OPEN_IF_EXISTS = (1<<5);
+const u_long File::APPEND = (1<<6);
+const u_long File::CREATE_ALWAYS = (1<<7);
+const u_long File::NO_INHERIT = (1<<8);
/*!
@@ -127,30 +127,30 @@
u_long attributeFlag = 0;
SECURITY_ATTRIBUTES sa = {0};
sa.nLength = sizeof(sa);
- if(opt & File::MYSERVER_NO_INHERIT)
+ if(opt & File::NO_INHERIT)
sa.bInheritHandle = FALSE;
else
sa.bInheritHandle = TRUE;
sa.lpSecurityDescriptor = NULL;
- if(opt & File::MYSERVER_OPEN_ALWAYS)
+ if(opt & File::OPEN_ALWAYS)
creationFlag|=OPEN_ALWAYS;
- if(opt & File::MYSERVER_OPEN_IFEXISTS)
+ if(opt & File::OPEN_IF_EXISTS)
creationFlag|=OPEN_EXISTING;
- if(opt & File::MYSERVER_CREATE_ALWAYS)
+ if(opt & File::CREATE_ALWAYS)
creationFlag|=CREATE_ALWAYS;
- if(opt & File::MYSERVER_OPEN_READ)
+ if(opt & File::READ)
openFlag|=GENERIC_READ;
- if(opt & File::MYSERVER_OPEN_WRITE)
+ if(opt & File::WRITE)
openFlag|=GENERIC_WRITE;
- if(opt & File::MYSERVER_OPEN_TEMPORARY)
+ if(opt & File::TEMPORARY)
{
openFlag |= FILE_ATTRIBUTE_TEMPORARY;
attributeFlag |= FILE_FLAG_DELETE_ON_CLOSE;
}
- if(opt & File::MYSERVER_OPEN_HIDDEN)
+ if(opt & File::HIDDEN)
openFlag|= FILE_ATTRIBUTE_HIDDEN;
if(attributeFlag == 0)
@@ -168,7 +168,7 @@
}
else/*! Open the file. */
{
- if(opt & File::MYSERVER_OPEN_APPEND)
+ if(opt & File::APPEND)
ret = seek (getFileSize ());
else
ret = seek (0);
@@ -182,15 +182,15 @@
#else
struct stat F_Stats;
int F_Flags;
- if(opt & File::MYSERVER_OPEN_READ && opt & File::MYSERVER_OPEN_WRITE)
+ if(opt & File::READ && opt & File::WRITE)
F_Flags = O_RDWR;
- else if(opt & File::MYSERVER_OPEN_READ)
+ else if(opt & File::READ)
F_Flags = O_RDONLY;
- else if(opt & File::MYSERVER_OPEN_WRITE)
+ else if(opt & File::WRITE)
F_Flags = O_WRONLY;
- if(opt & File::MYSERVER_OPEN_IFEXISTS)
+ if(opt & File::OPEN_IF_EXISTS)
{
ret = stat(filename.c_str(), &F_Stats);
if(ret < 0)
@@ -206,7 +206,7 @@
}
handle= (FileHandle)ret;
}
- else if(opt & File::MYSERVER_OPEN_APPEND)
+ else if(opt & File::APPEND)
{
ret = stat(filename.c_str(), &F_Stats);
if(ret < 0)
@@ -221,7 +221,7 @@
else
handle = (FileHandle)ret;
}
- else if(opt & File::MYSERVER_CREATE_ALWAYS)
+ else if(opt & File::CREATE_ALWAYS)
{
stat(filename.c_str(), &F_Stats);
if(ret)
@@ -236,7 +236,7 @@
else
handle=(FileHandle)ret;
}
- else if(opt & File::MYSERVER_OPEN_ALWAYS)
+ else if(opt & File::OPEN_ALWAYS)
{
ret = stat(filename.c_str(), &F_Stats);
@@ -254,7 +254,7 @@
handle = (FileHandle)ret;
}
- if(opt & File::MYSERVER_OPEN_TEMPORARY)
+ if(opt & File::TEMPORARY)
unlink(filename.c_str()); // Remove File on close
if((long)handle < 0)
@@ -335,11 +335,11 @@
if(FilesUtility::fileExists(filename))
FilesUtility::deleteFile(filename);
- return openFile(filename, File::MYSERVER_OPEN_READ |
- File::MYSERVER_OPEN_WRITE|
- File::MYSERVER_CREATE_ALWAYS |
- File::MYSERVER_OPEN_TEMPORARY |
- File::MYSERVER_NO_INHERIT);
+ return openFile(filename, File::READ |
+ File::WRITE|
+ File::CREATE_ALWAYS |
+ File::TEMPORARY |
+ File::NO_INHERIT);
}
/*!
Modified: trunk/myserver/src/base/file/files_utility.cpp
===================================================================
--- trunk/myserver/src/base/file/files_utility.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/base/file/files_utility.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -164,10 +164,10 @@
char buffer[4096];
size_t dim;
- if (srcFile.openFile (src, File::MYSERVER_OPEN_READ))
+ if (srcFile.openFile (src, File::READ))
return -1;
- if (destFile.openFile (dest, File::MYSERVER_OPEN_WRITE | (overwrite ?
File::MYSERVER_CREATE_ALWAYS : 0)))
+ if (destFile.openFile (dest, File::WRITE | (overwrite ? File::CREATE_ALWAYS
: 0)))
{
srcFile.close ();
return -1;
Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2009-05-22
22:00:04 UTC (rev 3092)
+++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2009-05-22
22:00:24 UTC (rev 3093)
@@ -56,8 +56,8 @@
refCounter = 0;
this->filename.assign(filename);
- file.openFile(filename, File::MYSERVER_OPEN_IFEXISTS |
- File::MYSERVER_OPEN_READ);
+ file.openFile(filename, File::OPEN_IF_EXISTS |
+ File::READ);
fileSize = file.getFileSize();
buffer = new char[fileSize];
Modified: trunk/myserver/src/base/files_cache/cached_file_factory.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2009-05-22
22:00:04 UTC (rev 3092)
+++ trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2009-05-22
22:00:24 UTC (rev 3093)
@@ -173,8 +173,8 @@
mutex.unlock();
file = new File();
- if(file->openFile(filename, File::MYSERVER_OPEN_IFEXISTS |
- File::MYSERVER_OPEN_READ))
+ if(file->openFile(filename, File::OPEN_IF_EXISTS |
+ File::READ))
{
delete file;
return 0;
@@ -187,8 +187,8 @@
{
u_long fileSize;
File *file = new File();
- if(file->openFile(filename, File::MYSERVER_OPEN_IFEXISTS |
- File::MYSERVER_OPEN_READ))
+ if(file->openFile(filename, File::OPEN_IF_EXISTS |
+ File::READ))
{
mutex.unlock();
delete file;
Modified: trunk/myserver/src/base/home_dir/home_dir.cpp
===================================================================
--- trunk/myserver/src/base/home_dir/home_dir.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/base/home_dir/home_dir.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -144,8 +144,8 @@
clear();
- if (usersFile.openFile("/etc/passwd", File::MYSERVER_OPEN_READ |
- File::MYSERVER_OPEN_IFEXISTS))
+ if (usersFile.openFile("/etc/passwd", File::READ |
+ File::OPEN_IF_EXISTS))
return 1;
size = usersFile.getFileSize();
timestamp = usersFile.getLastModTime();
Modified: trunk/myserver/src/conf/security/security_cache.cpp
===================================================================
--- trunk/myserver/src/conf/security/security_cache.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/conf/security/security_cache.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -199,7 +199,7 @@
if (maxSize)
{
File parserFile;
- if (parserFile.openFile (file.c_str (), File::MYSERVER_OPEN_READ))
+ if (parserFile.openFile (file.c_str (), File::READ))
return NULL;
if (parserFile.getFileSize () > maxSize)
Modified: trunk/myserver/src/http_handler/cgi/cgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/cgi/cgi.cpp 2009-05-22 22:00:04 UTC (rev
3092)
+++ trunk/myserver/src/http_handler/cgi/cgi.cpp 2009-05-22 22:00:24 UTC (rev
3093)
@@ -234,7 +234,7 @@
/*! Open the stdin file for the new CGI process. */
if(stdInFile.openFile(td->inputDataPath,
- File::MYSERVER_OPEN_READ | File::MYSERVER_OPEN_ALWAYS))
+ File::READ | File::OPEN_ALWAYS))
{
td->connection->host->warningsLogWrite("Cgi: Cannot open CGI stdin file.");
stdOutFile.close();
Modified: trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/http_handler/fastcgi/fastcgi.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -193,9 +193,9 @@
}
td->inputData.close();
- if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_OPEN_READ |
- File::MYSERVER_OPEN_ALWAYS |
- File::MYSERVER_NO_INHERIT))
+ if(td->inputData.openFile(td->inputDataPath, File::READ |
+ File::OPEN_ALWAYS |
+ File::NO_INHERIT))
{
td->buffer->setLength(0);
if(Server::getInstance()->getVerbosity() > 2)
Modified: trunk/myserver/src/http_handler/http_file/http_file.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_file/http_file.cpp 2009-05-22
22:00:04 UTC (rev 3092)
+++ trunk/myserver/src/http_handler/http_file/http_file.cpp 2009-05-22
22:00:24 UTC (rev 3093)
@@ -67,8 +67,8 @@
{
/*! If the file exists update it. */
File file;
- if(file.openFile(td->filenamePath.c_str(), File::MYSERVER_OPEN_IFEXISTS |
- File::MYSERVER_OPEN_WRITE))
+ if(file.openFile(td->filenamePath.c_str(), File::OPEN_IF_EXISTS |
+ File::WRITE))
{
/*! Return an internal server error. */
return td->http->raiseHTTPError(500);
@@ -115,8 +115,8 @@
*/
File file;
if(file.openFile(td->filenamePath.c_str(),
- File::MYSERVER_CREATE_ALWAYS |
- File::MYSERVER_OPEN_WRITE))
+ File::CREATE_ALWAYS |
+ File::WRITE))
{
/*! Internal server error. */
return td->http->raiseHTTPError(500);
Modified: trunk/myserver/src/http_handler/scgi/scgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/scgi/scgi.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/http_handler/scgi/scgi.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -184,9 +184,9 @@
return td->http->raiseHTTPError(500);
}
td->inputData.close();
- if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_OPEN_READ |
- File::MYSERVER_OPEN_ALWAYS |
- File::MYSERVER_NO_INHERIT))
+ if(td->inputData.openFile(td->inputDataPath, File::READ |
+ File::OPEN_ALWAYS |
+ File::NO_INHERIT))
{
td->buffer->setLength(0);
if(Server::getInstance()->getVerbosity() > 2)
Modified: trunk/myserver/src/http_handler/wincgi/wincgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/wincgi/wincgi.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/http_handler/wincgi/wincgi.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -143,7 +143,7 @@
*The WinCGI protocol uses a .ini file to send data to the new process.
*/
ret=DataFileHandle.openFile(dataFilePath,
- File::MYSERVER_CREATE_ALWAYS|File::MYSERVER_OPEN_WRITE);
+ File::CREATE_ALWAYS|File::WRITE);
if ( ret )
{
td->connection->host->warningsLogWrite("WinCGI: Error creating .ini");
@@ -287,7 +287,7 @@
*/
if(!FilesUtility::fileExists(outFilePath))
{
- ret = OutFileHandle.openFile(outFilePath, File::MYSERVER_CREATE_ALWAYS);
+ ret = OutFileHandle.openFile(outFilePath, File::CREATE_ALWAYS);
if (ret)
{
td->connection->host->warningsLogWrite(
@@ -318,8 +318,8 @@
return td->http->raiseHTTPError(500);
}
- ret=OutFileHandle.openFile(outFilePath, File::MYSERVER_OPEN_ALWAYS|
- File::MYSERVER_OPEN_READ);
+ ret=OutFileHandle.openFile(outFilePath, File::OPEN_ALWAYS|
+ File::READ);
if (ret)
{
ostringstream msg;
Modified: trunk/myserver/src/log/stream/file_stream.cpp
===================================================================
--- trunk/myserver/src/log/stream/file_stream.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/log/stream/file_stream.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -1,6 +1,6 @@
/*
MyServer
- Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -18,11 +18,11 @@
#include <include/log/stream/file_stream.h>
int const FileStream::defaultFileMask =
- File::MYSERVER_OPEN_APPEND |
- File::MYSERVER_OPEN_ALWAYS |
- File::MYSERVER_OPEN_WRITE |
- File::MYSERVER_OPEN_READ |
- File::MYSERVER_NO_INHERIT;
+ File::APPEND |
+ File::OPEN_ALWAYS |
+ File::WRITE |
+ File::READ |
+ File::NO_INHERIT;
FileStream::FileStream (FiltersFactory* ff, u_long cycle, Stream* out,
FiltersChain* fc) :
@@ -62,9 +62,9 @@
}
if (newFile.openFile (newFileName,
- File::MYSERVER_OPEN_WRITE |
- File::MYSERVER_NO_INHERIT |
- File::MYSERVER_CREATE_ALWAYS))
+ File::WRITE |
+ File::NO_INHERIT |
+ File::CREATE_ALWAYS))
{
cerr << "could not open " << newFileName << endl;
delete [] buffer;
Modified: trunk/myserver/src/protocol/control/control_protocol.cpp
===================================================================
--- trunk/myserver/src/protocol/control/control_protocol.cpp 2009-05-22
22:00:04 UTC (rev 3092)
+++ trunk/myserver/src/protocol/control/control_protocol.cpp 2009-05-22
22:00:24 UTC (rev 3093)
@@ -842,7 +842,7 @@
filename = fn;
}
- ret = localfile.openFile(filename, File::MYSERVER_OPEN_READ |
File::MYSERVER_OPEN_IFEXISTS);
+ ret = localfile.openFile(filename, File::READ | File::OPEN_IF_EXISTS);
/* An internal server error happens. */
if(ret)
@@ -933,7 +933,7 @@
return CONTROL_INTERNAL;
}
- ret = localfile.openFile(filename, File::MYSERVER_OPEN_WRITE |
File::MYSERVER_OPEN_ALWAYS);
+ ret = localfile.openFile(filename, File::WRITE | File::OPEN_ALWAYS);
/* An internal server error happens. */
if(ret)
Modified: trunk/myserver/src/protocol/ftp/ftp.cpp
===================================================================
--- trunk/myserver/src/protocol/ftp/ftp.cpp 2009-05-22 22:00:04 UTC (rev
3092)
+++ trunk/myserver/src/protocol/ftp/ftp.cpp 2009-05-22 22:00:24 UTC (rev
3093)
@@ -1159,9 +1159,9 @@
{
u_long flags = 0;
if ( pWt->m_bAppend )
- flags = File::MYSERVER_OPEN_APPEND | File::MYSERVER_OPEN_WRITE;
+ flags = File::APPEND | File::WRITE;
else
- flags = File::MYSERVER_CREATE_ALWAYS | File::MYSERVER_OPEN_WRITE;
+ flags = File::CREATE_ALWAYS | File::WRITE;
if ( file.openFile(pWt->m_sFilePath.c_str(), flags) )
{
ftp_reply(pConnection, 451);
@@ -1352,9 +1352,9 @@
{
u_long flags = 0;
if ( pWt->m_bAppend )
- flags = File::MYSERVER_OPEN_APPEND | File::MYSERVER_OPEN_WRITE;
+ flags = File::APPEND | File::WRITE;
else
- flags = File::MYSERVER_CREATE_ALWAYS | File::MYSERVER_OPEN_WRITE;
+ flags = File::CREATE_ALWAYS | File::WRITE;
if ( file.openFile(pWt->m_sFilePath.c_str(), flags) )
{
ftp_reply(pConnection, 451);
Modified: trunk/myserver/src/protocol/http/http_data_read.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_data_read.cpp 2009-05-22 22:00:04 UTC
(rev 3092)
+++ trunk/myserver/src/protocol/http/http_data_read.cpp 2009-05-22 22:00:24 UTC
(rev 3093)
@@ -310,9 +310,9 @@
*Create the file that contains the posted data.
*This data is the stdin file in the CGI.
*/
- if(td->inputData.openFile(td->inputDataPath, File::MYSERVER_CREATE_ALWAYS |
- File::MYSERVER_OPEN_READ |
- File::MYSERVER_OPEN_WRITE))
+ if(td->inputData.openFile(td->inputDataPath, File::CREATE_ALWAYS |
+ File::READ |
+ File::WRITE))
{
*httpRetCode = 500;
return 1;
Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp 2009-05-22 22:00:04 UTC (rev
3092)
+++ trunk/myserver/src/server/server.cpp 2009-05-22 22:00:24 UTC (rev
3093)
@@ -205,13 +205,13 @@
sSource.append ("default.xml");
#endif
- ret = inputF.openFile (sSource, File::MYSERVER_OPEN_READ
- | File::MYSERVER_OPEN_IFEXISTS);
+ ret = inputF.openFile (sSource, File::READ
+ | File::OPEN_IF_EXISTS);
if (ret)
return -1;
- ret = outputF.openFile (fileName, File::MYSERVER_OPEN_WRITE
- | File::MYSERVER_OPEN_ALWAYS);
+ ret = outputF.openFile (fileName, File::WRITE
+ | File::OPEN_ALWAYS);
if (ret)
return -1;
Modified: trunk/myserver/tests/test_file.cpp
===================================================================
--- trunk/myserver/tests/test_file.cpp 2009-05-22 22:00:04 UTC (rev 3092)
+++ trunk/myserver/tests/test_file.cpp 2009-05-22 22:00:24 UTC (rev 3093)
@@ -70,9 +70,9 @@
u_long nbw;
u_long nbr;
- CPPUNIT_ASSERT_EQUAL (tfile->openFile( fname.c_str (),
File::MYSERVER_OPEN_WRITE |
- File::MYSERVER_OPEN_READ |
- File::MYSERVER_CREATE_ALWAYS ), 0);
+ CPPUNIT_ASSERT_EQUAL (tfile->openFile( fname.c_str (), File::WRITE |
+ File::READ |
+ File::CREATE_ALWAYS ), 0);
CPPUNIT_ASSERT_EQUAL (tfile->writeToFile ( buf, bufLen, &nbw ), 0);
Modified: trunk/myserver/tests/test_ssl_socket.cpp
===================================================================
--- trunk/myserver/tests/test_ssl_socket.cpp 2009-05-22 22:00:04 UTC (rev
3092)
+++ trunk/myserver/tests/test_ssl_socket.cpp 2009-05-22 22:00:24 UTC (rev
3093)
@@ -105,11 +105,11 @@
u_long nbw;
File f;
- f.openFile (TESTSERVERKEY, File::MYSERVER_OPEN_WRITE |
File::MYSERVER_CREATE_ALWAYS);
+ f.openFile (TESTSERVERKEY, File::WRITE | File::CREATE_ALWAYS);
f.writeToFile (serverKey, strlen (serverKey), &nbw);
f.close ();
- f.openFile (TESTSERVERPEM, File::MYSERVER_OPEN_WRITE |
File::MYSERVER_CREATE_ALWAYS);
+ f.openFile (TESTSERVERPEM, File::WRITE | File::CREATE_ALWAYS);
f.writeToFile (serverPem, strlen (serverPem), &nbw);
f.close ();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [3093] Refactoring: file open modes now have a shorter name.,
Giuseppe Scrivano <=