mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-15 08:01:33 +00:00
Various tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@21421 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9f7710abc7
commit
2d123b3b54
5 changed files with 62 additions and 24 deletions
|
@ -1,3 +1,12 @@
|
|||
2005-07-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* MySQL.m:
|
||||
* SQLClient.m:
|
||||
* WebServer.h:
|
||||
* WebServer.m:
|
||||
Tweaks to keep gcc-4 happy (signedness issues) and add support for
|
||||
using separate ssl conmfig for different IP addresses.
|
||||
|
||||
2005-06-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Expand tilde in paths searched for backend bundles.
|
||||
|
|
8
MySQL.m
8
MySQL.m
|
@ -305,7 +305,7 @@ static unsigned int trim(char *str)
|
|||
|
||||
for (i = 0; i < fieldCount; i++)
|
||||
{
|
||||
keys[i] = [NSString stringWithUTF8String: fields[i].name];
|
||||
keys[i] = [NSString stringWithUTF8String: (char*)fields[i].name];
|
||||
}
|
||||
|
||||
records = [[NSMutableArray alloc] initWithCapacity: recordCount];
|
||||
|
@ -320,7 +320,7 @@ static unsigned int trim(char *str)
|
|||
for (j = 0; j < fieldCount; j++)
|
||||
{
|
||||
id v = null;
|
||||
unsigned char *p = row[j];
|
||||
unsigned char *p = (unsigned char*)row[j];
|
||||
|
||||
if (p != 0)
|
||||
{
|
||||
|
@ -405,8 +405,8 @@ static unsigned int trim(char *str)
|
|||
break;
|
||||
|
||||
default:
|
||||
trim(p);
|
||||
v = [NSString stringWithUTF8String: p];
|
||||
trim((char*)p);
|
||||
v = [NSString stringWithUTF8String: (char*)p];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
19
SQLClient.m
19
SQLClient.m
|
@ -634,12 +634,13 @@ static unsigned int maxConnections = 8;
|
|||
name: (NSString*)reference
|
||||
{
|
||||
NSNotification *n;
|
||||
id conf = config;
|
||||
NSDictionary *conf = config;
|
||||
id existing;
|
||||
|
||||
if (conf == nil)
|
||||
{
|
||||
conf = [NSUserDefaults standardUserDefaults];
|
||||
// Pretend the defaults object is a dictionary.
|
||||
conf = (NSDictionary*)[NSUserDefaults standardUserDefaults];
|
||||
}
|
||||
|
||||
if ([reference isKindOfClass: NSStringClass] == NO)
|
||||
|
@ -1239,7 +1240,7 @@ static void quoteString(NSMutableString *s)
|
|||
*/
|
||||
- (void) _configure: (NSNotification*)n
|
||||
{
|
||||
id o = [n object];
|
||||
NSDictionary *o = [n object];
|
||||
NSDictionary *d;
|
||||
NSString *s;
|
||||
Class c;
|
||||
|
@ -1292,7 +1293,7 @@ static void quoteString(NSMutableString *s)
|
|||
/* Try alternative version with more libraries linked in.
|
||||
* In some systems and situations the dynamic linker needs
|
||||
* to haved the SQLClient, gnustep-base, and objc libraries
|
||||
* explicityly linked into the bundle, but in others it
|
||||
* explicitly linked into the bundle, but in others it
|
||||
* requires them to not be linked. To handle that, we create
|
||||
* two versions of each bundle, the seond version has _libs
|
||||
* appended to the bundle name, and has the extra libraries linked.
|
||||
|
@ -1456,7 +1457,7 @@ static void quoteString(NSMutableString *s)
|
|||
NSRange s;
|
||||
NSString *v;
|
||||
NSString *alt;
|
||||
id o;
|
||||
id o;
|
||||
unsigned i;
|
||||
|
||||
r.length = l - pos;
|
||||
|
@ -1527,7 +1528,7 @@ static void quoteString(NSMutableString *s)
|
|||
|
||||
if ([k length] > 0)
|
||||
{
|
||||
o = [o objectForKey: k];
|
||||
o = [(NSDictionary*)o objectForKey: k];
|
||||
}
|
||||
}
|
||||
if (o == vals)
|
||||
|
@ -1538,7 +1539,7 @@ static void quoteString(NSMutableString *s)
|
|||
{
|
||||
if ([o isKindOfClass: NSStringClass] == YES)
|
||||
{
|
||||
v = o;
|
||||
v = (NSString*)o;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1688,9 +1689,9 @@ static void quoteString(NSMutableString *s)
|
|||
{
|
||||
return [query hash];
|
||||
}
|
||||
- (BOOL) isEqual: (SQLClientCacheInfo*)other
|
||||
- (BOOL) isEqual: (id)other
|
||||
{
|
||||
return [query isEqual: other->query];
|
||||
return [query isEqual: ((SQLClientCacheInfo*)other)->query];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -419,6 +419,11 @@
|
|||
* <code>KeyFile</code> and <code>Password</code> then the server will
|
||||
* use the specified certificate and key files (which it will access
|
||||
* using the password).<br />
|
||||
* The <em>secure</em> dictionary may also contain other dictionaries
|
||||
* keyed on IP addresses, and if the address that an incoming connection
|
||||
* arrived on matches the key of a dictionary, that dictionary is used
|
||||
* to provide the certificate information, with the top-level values
|
||||
* being used as a fallback.<br />
|
||||
* This method returns YES on success, NO on failure ... if it returns NO
|
||||
* then the receiver will <em>not</em> be capable of handling incoming
|
||||
* web requests!<br />
|
||||
|
|
45
WebServer.m
45
WebServer.m
|
@ -211,7 +211,9 @@
|
|||
password = [[request headerNamed: @"x-http-password"] value];
|
||||
if ([access objectForKey: @"Users"] != nil)
|
||||
{
|
||||
stored = [[access objectForKey: @"Users"] objectForKey: username];
|
||||
NSDictionary *users = [access objectForKey: @"Users"];
|
||||
|
||||
stored = [users objectForKey: username];
|
||||
}
|
||||
else if ([access objectForKey: @"UserDB"] != nil)
|
||||
{
|
||||
|
@ -246,7 +248,7 @@
|
|||
if (sql == nil)
|
||||
{
|
||||
sql = [c alloc];
|
||||
sql = [c initWithConfiguration: nil name: name];
|
||||
sql = [sql initWithConfiguration: nil name: name];
|
||||
}
|
||||
stored = [sql queryString: @"SELECT ",
|
||||
[info objectForKey: @"Password"],
|
||||
|
@ -1160,9 +1162,30 @@ escapeData(const unsigned char* bytes, unsigned length, NSMutableData *d)
|
|||
{
|
||||
if (_sslConfig != nil)
|
||||
{
|
||||
[hdl sslSetCertificate: [_sslConfig objectForKey: @"CertificateFile"]
|
||||
privateKey: [_sslConfig objectForKey: @"KeyFile"]
|
||||
PEMpasswd: [_sslConfig objectForKey: @"Password"]];
|
||||
NSString *address = [hdl socketLocalAddress];
|
||||
NSDictionary *primary = [_sslConfig objectForKey: address];
|
||||
NSString *certificateFile;
|
||||
NSString *keyFile;
|
||||
NSString *password;
|
||||
|
||||
certificateFile = [primary objectForKey: @"CertificateFile"];
|
||||
if (certificateFile == nil)
|
||||
{
|
||||
certificateFile = [_sslConfig objectForKey: @"CertificateFile"];
|
||||
}
|
||||
keyFile = [primary objectForKey: @"KeyFile"];
|
||||
if (keyFile == nil)
|
||||
{
|
||||
keyFile = [_sslConfig objectForKey: @"KeyFile"];
|
||||
}
|
||||
password = [primary objectForKey: @"Password"];
|
||||
if (password == nil)
|
||||
{
|
||||
password = [_sslConfig objectForKey: @"Password"];
|
||||
}
|
||||
[hdl sslSetCertificate: certificateFile
|
||||
privateKey: keyFile
|
||||
PEMpasswd: password];
|
||||
}
|
||||
|
||||
if ((h = [NSHost hostWithAddress: a]) == nil)
|
||||
|
@ -1363,10 +1386,10 @@ escapeData(const unsigned char* bytes, unsigned length, NSMutableData *d)
|
|||
{
|
||||
bytes[back] = '\0';
|
||||
end = back + 1;
|
||||
if (strncmp(bytes + end, "HTTP/", 5) == 0)
|
||||
if (strncmp((char*)bytes + end, "HTTP/", 5) == 0)
|
||||
{
|
||||
end += 5;
|
||||
version = [NSString stringWithUTF8String: bytes + end];
|
||||
version = [NSString stringWithUTF8String: (char*)bytes + end];
|
||||
}
|
||||
}
|
||||
if ([version floatValue] < 1.1)
|
||||
|
@ -1396,7 +1419,7 @@ escapeData(const unsigned char* bytes, unsigned length, NSMutableData *d)
|
|||
end++;
|
||||
}
|
||||
bytes[end++] = '\0';
|
||||
method = [NSString stringWithUTF8String: bytes + start];
|
||||
method = [NSString stringWithUTF8String: (char*)bytes + start];
|
||||
|
||||
/*
|
||||
* Extract path string.
|
||||
|
@ -1417,14 +1440,14 @@ escapeData(const unsigned char* bytes, unsigned length, NSMutableData *d)
|
|||
* Extract query string.
|
||||
*/
|
||||
bytes[end++] = '\0';
|
||||
query = [NSString stringWithUTF8String: bytes + end];
|
||||
query = [NSString stringWithUTF8String: (char*)bytes + end];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
bytes[end] = '\0';
|
||||
}
|
||||
path = [NSString stringWithUTF8String: bytes + start];
|
||||
path = [NSString stringWithUTF8String: (char*)bytes + start];
|
||||
|
||||
if ([method isEqualToString: @"GET"] == NO
|
||||
&& [method isEqualToString: @"POST"] == NO)
|
||||
|
@ -1673,7 +1696,7 @@ escapeData(const unsigned char* bytes, unsigned length, NSMutableData *d)
|
|||
|
||||
for (pos = 4; pos < len; pos++)
|
||||
{
|
||||
if (strncmp(&buf[pos-4], "\r\n\r\n", 4) == 0)
|
||||
if (strncmp((char*)&buf[pos-4], "\r\n\r\n", 4) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue