~ubuntu-branches/ubuntu/wily/pianobar/wily-proposed

« back to all changes in this revision

Viewing changes to src/libwaitress/waitress.c

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2012-05-06 14:24:34 UTC
  • mfrom: (1.3.9)
  • Revision ID: package-import@ubuntu.com-20120506142434-74kwucnyp97msxdi
Tags: 2012.05.06-1
* New upstream version.
  - JSON api support (closes: #670483, LP: #988395)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <poll.h>
40
40
#include <errno.h>
41
41
#include <assert.h>
 
42
#include <stdint.h>
42
43
 
43
44
#include <gnutls/x509.h>
44
45
 
1063
1064
 
1064
1065
        /* initialize */
1065
1066
        memset (&waith->request, 0, sizeof (waith->request));
 
1067
        waith->request.sockfd = -1;
1066
1068
        waith->request.dataHandler = WaitressHandleIdentity;
1067
1069
        waith->request.read = WaitressOrdinaryRead;
1068
1070
        waith->request.write = WaitressOrdinaryWrite;
1104
1106
                gnutls_deinit (waith->request.tlsSession);
1105
1107
                gnutls_certificate_free_credentials (waith->tlsCred);
1106
1108
        }
1107
 
        close (waith->request.sockfd);
 
1109
        if (waith->request.sockfd != -1) {
 
1110
                close (waith->request.sockfd);
 
1111
        }
1108
1112
        free (waith->request.buf);
1109
1113
 
1110
1114
        if (wRet == WAITRESS_RET_OK &&