Remove NGHTTP2_ERR_GZIP error code

This commit is contained in:
Tatsuhiro Tsujikawa 2014-05-06 23:42:57 +09:00
parent 43fb7f707f
commit 9228e223fa
4 changed files with 6 additions and 22 deletions

View File

@ -284,10 +284,6 @@ typedef enum {
* requested operation.
*/
NGHTTP2_ERR_INVALID_STATE = -519,
/**
* The gzip error.
*/
NGHTTP2_ERR_GZIP = -520,
/**
* The user callback function failed due to the temporal error.
*/

View File

@ -201,8 +201,6 @@ const char* nghttp2_strerror(int error_code)
return "Invalid header block";
case NGHTTP2_ERR_INVALID_STATE:
return "Invalid state";
case NGHTTP2_ERR_GZIP:
return "Gzip error";
case NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE:
return "The user callback function failed due to the temporal error";
case NGHTTP2_ERR_FRAME_SIZE_ERROR:

View File

@ -31,7 +31,7 @@ int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)
int rv;
*inflater_ptr = malloc(sizeof(nghttp2_gzip));
if(*inflater_ptr == NULL) {
return NGHTTP2_ERR_NOMEM;
return -1;
}
(*inflater_ptr)->finished = 0;
(*inflater_ptr)->zst.next_in = Z_NULL;
@ -42,7 +42,7 @@ int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)
rv = inflateInit2(&(*inflater_ptr)->zst, 47);
if(rv != Z_OK) {
free(*inflater_ptr);
return NGHTTP2_ERR_GZIP;
return -1;
}
return 0;
}
@ -61,7 +61,7 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
{
int rv;
if(inflater->finished) {
return NGHTTP2_ERR_GZIP;
return -1;
}
inflater->zst.avail_in = *inlen_ptr;
inflater->zst.next_in = (unsigned char*)in;
@ -82,7 +82,7 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
case Z_STREAM_ERROR:
case Z_NEED_DICT:
case Z_MEM_ERROR:
return NGHTTP2_ERR_GZIP;
return -1;
default:
assert(0);
/* We need this for some compilers */

View File

@ -51,13 +51,7 @@ typedef struct {
* A helper function to set up a per request gzip stream to inflate
* data.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* :enum:`NGHTTP2_ERR_GZIP`
* The initialization of gzip stream failed.
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
* This function returns 0 if it succeeds, or -1.
*/
int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr);
@ -77,11 +71,7 @@ void nghttp2_gzip_inflate_del(nghttp2_gzip *inflater);
* the number of data written in |out|. Similarly, |*inlen_ptr| is
* updated to represent the number of input bytes processed.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* :enum:`NGHTTP2_ERR_GZIP`
* The inflation of gzip stream failed.
* This function returns 0 if it succeeds, or -1.
*
* The example follows::
*