~ubuntu-branches/ubuntu/jaunty/nss/jaunty-proposed

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Fabien Tassin, Alexander Sack
  • Date: 2009-01-11 15:06:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090111150617-iz4lw05qgy2odorl
Tags: 3.12.2~rc1-0ubuntu1
* New upstream snapshot: 3.12.2 RC1

[ Fabien Tassin <fta@ubuntu.com> ]
* Remove patch applied upstream:
  - drop debian/patches/80_security_tools.patch
  - update debian/patches/series
* Update diverged patches:
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
* Add new symbols to symbols file
  - update debian/libnss3-1d.symbols

[ Alexander Sack <asac@ubuntu.com> ]
* disable soname patch to become binary compatible with upstream
  - update debian/patches/series
* flip links: libnss3.so <- libnss3.so.1d (before: libnss3.so ->
  libnss3.so.1d); same link flipping was done for all other previously
  soname patched libs: libnssutil3.so, libsmime3.so.1d, libssl3.so.1d
  - update debian/libnss3-1d.links
  - update debian/libnss3-1d.symbols
* properly transition links in preinst and postrm; also cover abort-
  cases in the other maintainer scripts
  - add debian/libnss3-1d.postinst
  - add debian/libnss3-1d.postrm
  - add debian/libnss3-1d.preinst
  - add debian/libnss3-1d.prerm
* remove hack from debian/rules that debian uses to recreate
  libsoftokn3.so with a versioned SONAME
  - update debian/rules
* install the unversioned .so binaries
  - update debian/rules
* only install the 4 main libraries into /usr/lib; all the others
  go to pkglibdir
  - update debian/rules
* higher bar for libnspr4 Build-Depend to >= 4.7.3~, which is
  the version where the soname droppage is going to happen
  - update debian/control
* explitily pass libraries to be used for dpkg-gensymbols run of
  dh_makeshlibs
  - update debian/rules
* fix lintian complain about no-shlibs-control-file
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
                PKIX_MALLOCFAILED);
179
179
 
180
180
        /* copy header data before we corrupt it (by storing NULLs) */
181
 
        PKIX_CHECK(PKIX_PL_Memcpy
182
 
                (client->rcvBuf, headerLength, (void **)&copy, plContext),
183
 
                PKIX_MEMCPYFAILED);
 
181
        PORT_Memcpy(copy, client->rcvBuf, headerLength);
184
182
 
185
183
        /* Store the NULL terminator */
186
184
        copy[headerLength] = '\0';
342
340
 
343
341
        /* copy any remaining bytes in current buffer into new buffer */
344
342
        if (client->currentBytesAvailable > 0) {
345
 
                PKIX_CHECK(PKIX_PL_Memcpy
346
 
                        (&(client->rcvBuf[headerLength]),
347
 
                        client->currentBytesAvailable,
348
 
                        (void **)&body,
349
 
                        plContext),
350
 
                        PKIX_MEMCPYFAILED);
 
343
                PORT_Memcpy(body, &(client->rcvBuf[headerLength]),
 
344
                                     client->currentBytesAvailable);
351
345
        }
352
346
 
353
347
        PKIX_CHECK(PKIX_PL_Free(client->rcvBuf, plContext),
416
410
        PKIX_PL_HttpDefaultClient *client = NULL;
417
411
 
418
412
        PKIX_ENTER(HTTPDEFAULTCLIENT, "PKIX_PL_HttpDefaultClient_Create");
419
 
        PKIX_NULLCHECK_ONE(pClient);
 
413
        PKIX_NULLCHECK_TWO(pClient, host);
420
414
 
421
415
        /* allocate an HttpDefaultClient */
422
416
        PKIX_CHECK(PKIX_PL_Object_Alloc
445
439
        client->GETBuf = NULL;
446
440
        client->POSTBuf = NULL;
447
441
        client->rcvBuf = NULL;
448
 
        client->host = host;
 
442
        /* "host" is a parsing result by CERT_GetURL function that adds
 
443
         * "end of line" to the value. OK to dup the string. */
 
444
        client->host = PORT_Strdup(host);
 
445
        if (!client->host) {
 
446
            PKIX_ERROR(PKIX_ALLOCERROR);
 
447
        }
449
448
        client->path = NULL;
450
449
        client->rcvContentType = NULL;
451
450
        client->rcvHeaders = NULL;
501
500
                PR_smprintf_free(client->GETBuf);
502
501
                client->GETBuf = NULL;
503
502
        }
504
 
 
505
503
        if (client->POSTBuf != NULL) {
506
504
                PKIX_PL_Free(client->POSTBuf, plContext);
507
505
                client->POSTBuf = NULL;
508
506
        }
509
 
 
510
507
        if (client->rcvBuf != NULL) {
511
508
                PKIX_PL_Free(client->rcvBuf, plContext);
512
509
                client->rcvBuf = NULL;
513
510
        }
514
 
 
 
511
        if (client->host) {
 
512
                PORT_Free(client->host);
 
513
                client->host = NULL;
 
514
        }
 
515
        if (client->path) {
 
516
                PORT_Free(client->path);
 
517
                client->path = NULL;
 
518
        }
515
519
        PKIX_DECREF(client->socket);
516
520
 
517
521
cleanup:
1260
1264
                PKIX_ERROR(PKIX_UNRECOGNIZEDREQUESTMETHOD);
1261
1265
        }
1262
1266
 
1263
 
        client->path = path_and_query_string;
 
1267
        if (path_and_query_string) {
 
1268
            /* "path_and_query_string" is a parsing result by CERT_GetURL
 
1269
             * function that adds "end of line" to the value. OK to dup
 
1270
             * the string. */
 
1271
            client->path = PORT_Strdup(path_and_query_string);
 
1272
            if (!client->path) {
 
1273
                PKIX_ERROR(PKIX_ALLOCERROR);
 
1274
            }
 
1275
        }
1264
1276
 
1265
1277
        client->timeout = timeout;
1266
1278
 
1372
1384
        PKIX_UInt32 postLen = 0;
1373
1385
        PRPollDesc *pollDesc = NULL;
1374
1386
        char *sendbuf = NULL;
1375
 
        void *appendDest = NULL;
1376
1387
 
1377
1388
        PKIX_ENTER
1378
1389
                (HTTPDEFAULTCLIENT,
1441
1452
                                PKIX_MALLOCFAILED);
1442
1453
 
1443
1454
                        /* copy header into postBuffer */
1444
 
                        PKIX_CHECK(PKIX_PL_Memcpy
1445
 
                                (sendbuf,
1446
 
                                postLen,
1447
 
                                (void **)&(client->POSTBuf),
1448
 
                                plContext),
1449
 
                                PKIX_MEMCPYFAILED);
 
1455
                        PORT_Memcpy(client->POSTBuf, sendbuf, postLen);
1450
1456
 
1451
1457
                        /* append data after header */
1452
 
                        appendDest = (void *)&(client->POSTBuf[postLen]);
1453
 
                        PKIX_CHECK(PKIX_PL_Memcpy
1454
 
                                ((void *)(client->send_http_data),
1455
 
                                 client->send_http_data_len,
1456
 
                                 (void **)&appendDest,
1457
 
                                plContext),
1458
 
                                PKIX_MEMCPYFAILED);
 
1458
                        PORT_Memcpy(&client->POSTBuf[postLen],
 
1459
                                    client->send_http_data,
 
1460
                                    client->send_http_data_len);
1459
1461
 
1460
1462
                        /* PR_smprintf_free original header buffer */
1461
1463
                        PKIX_PL_NSSCALL