projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52d4f46
)
* catch NULL pointers for log-messages.
author
Wilfried Göesgens
<willi@citadel.org>
Mon, 3 Aug 2009 21:33:57 +0000
(21:33 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Mon, 3 Aug 2009 21:33:57 +0000
(21:33 +0000)
webcit/tcp_sockets.c
patch
|
blob
|
history
diff --git
a/webcit/tcp_sockets.c
b/webcit/tcp_sockets.c
index 02515306be01435b324767c9e3ab87de76e2021f..2c928e199d951c8d2695130fd0900a3f5dd81d41 100644
(file)
--- a/
webcit/tcp_sockets.c
+++ b/
webcit/tcp_sockets.c
@@
-172,7
+172,7
@@
int StrBuf_ServGetln(StrBuf *buf)
if (rc < 0)
{
lprintf(1, "Server connection broken: %s\n",
if (rc < 0)
{
lprintf(1, "Server connection broken: %s\n",
-
ErrStr
);
+
(ErrStr)?ErrStr:""
);
wc_backtrace();
WCC->serv_sock = (-1);
WCC->connected = 0;
wc_backtrace();
WCC->serv_sock = (-1);
WCC->connected = 0;
@@
-184,7
+184,7
@@
int StrBuf_ServGetln(StrBuf *buf)
int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize)
{
wcsession *WCC = WC;
int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize)
{
wcsession *WCC = WC;
- const char *Err;
+ const char *Err
Str
;
int rc;
rc = StrBufReadBLOBBuffered(buf,
int rc;
rc = StrBufReadBLOBBuffered(buf,
@@
-194,11
+194,11
@@
int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize)
1,
BlobSize,
NNN_TERM,
1,
BlobSize,
NNN_TERM,
- &Err);
+ &Err
Str
);
if (rc < 0)
{
lprintf(1, "Server connection broken: %s\n",
if (rc < 0)
{
lprintf(1, "Server connection broken: %s\n",
-
Err
);
+
(ErrStr)?ErrStr:""
);
wc_backtrace();
WCC->serv_sock = (-1);
WCC->connected = 0;
wc_backtrace();
WCC->serv_sock = (-1);
WCC->connected = 0;
@@
-210,7
+210,7
@@
int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize)
int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize)
{
wcsession *WCC = WC;
int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize)
{
wcsession *WCC = WC;
- const char *Err;
+ const char *Err
Str
;
int rc;
WCC->ReadPos = NULL;
int rc;
WCC->ReadPos = NULL;
@@
-218,7
+218,7
@@
int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize)
if (rc < 0)
{
lprintf(1, "Server connection broken: %s\n",
if (rc < 0)
{
lprintf(1, "Server connection broken: %s\n",
-
Err
);
+
(ErrStr)?ErrStr:""
);
wc_backtrace();
WCC->serv_sock = (-1);
WCC->connected = 0;
wc_backtrace();
WCC->serv_sock = (-1);
WCC->connected = 0;
@@
-244,8
+244,9
@@
void serv_write(const char *buf, int nbytes)
retval = write(WCC->serv_sock, &buf[bytes_written],
nbytes - bytes_written);
if (retval < 1) {
retval = write(WCC->serv_sock, &buf[bytes_written],
nbytes - bytes_written);
if (retval < 1) {
+ const char *StrError = strerror(errno));
lprintf(1, "Server connection broken: %s\n",
lprintf(1, "Server connection broken: %s\n",
-
strerror(errno)
);
+
(ErrStr)?ErrStr:""
);
close(WCC->serv_sock);
WCC->serv_sock = (-1);
WCC->connected = 0;
close(WCC->serv_sock);
WCC->serv_sock = (-1);
WCC->connected = 0;