Permalink
Browse files

Fixed a logic error with my recent gzip patch

The gzip patch I submitted recently assumes that apr_socket_data_get
returns with an error code if there is no data in the socket;
however, this is not always the case. This patch explicitly checks
for the data we want instead of relying on the error code to
indicate its presence.
  • Loading branch information...
1 parent f6c5db3 commit 05f0453cbe0f6f8e3c3a16c931c7415e76f30b5c @comptonqc comptonqc committed Feb 21, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 gmond/gmond.c
View
@@ -264,7 +264,7 @@ socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
int z_ret;
ret = apr_socket_data_get((void**)&strm, GZIP_KEY, sock);
- if (ret != APR_SUCCESS)
+ if (ret != APR_SUCCESS || strm == NULL)
{
ret = socket_send_raw( sock, buf, len );
}

0 comments on commit 05f0453

Please sign in to comment.