亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? httpheader.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
字號(hào):
/*
 * Copyright (C) 2003-2007 Funambol, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */

// This class represents an HTTP header as read from a buffer or stream
//

#include <stdlib.h>
#include <string.h>

#include "http/constants.h"
#include "http/HTTPHeader.h"

/*
 * Creates a HTTPHeader from a chars buffer. See HTTP protocol specification
 * (RFC 2616) for details. Note that the internal fields are pointers to
 * buffer positions, so the scope of the HTTPHeader object must be the
 * same of the passed in.buffer.
 *
 * @parfam buf - IN - the buffer containing the header data
 */
HTTPHeader::HTTPHeader(char* buf) {
    char *p1 = NULL;
    char *p2 = NULL;
    char *p3 = NULL;

    int l;

    size = (unsigned int)-1;

    //
    // The header boundary is the first CRLFCRLF couple.
    //
    p1 = strstr(buf, "\r\n\r\n");

    if (p1 == NULL) {
        status = (unsigned int)-1;
        statusMessage = MSG_BAD_PROTOCOL;

        goto finally;
    }

    content = p1 + 4;
    size = content - buf;
    *p1 = 0;

    //
    // Gets the status line
    //
    p1 = strstr(buf, "\r\n");
    if (p1 != NULL) {
        *p1 = 0; p1 += 2; // now p1 points to the next line
    }

    version = strtok(buf, " ");  // version
    if (version == NULL) {
        status = (unsigned int)-1;
        statusMessage = MSG_BAD_PROTOCOL;

        goto finally;
    }

    p2 = strtok(NULL, " "); // status
    if (p2 == NULL) {
        status = (unsigned int)-1;
        statusMessage = MSG_BAD_PROTOCOL;

        goto finally;
    }
    status = atoi(p2);

    statusMessage = strtok(NULL, " "); // this is optional

    //
    // Reads the headers (p1 points to the begining of the line)
    // Headers are in the form:
    //
    // <headername>: <header content>CRLN
    //
    //
    headersCount = 0;
    while ((p1 != NULL) && (*p1) && (headersCount < DIM_HEADERS)) {
        p2 = strstr(p1, "\r\n");
        if (p2 != NULL) {
            *p2 = 0; p2 += 2; // terminates this line and goes to the next one
        }

        //
        // remove heading spaces
        //
        while (*p1 == ' ') {
            ++p1;
        }
        p3 = strchr(p1, ':');
        if (p3 != NULL) {
            *p3 = 0; p3 += 1;  // p3 now points to the value

            //
            // remove tailing spaces in the header
            //
            l = strlen(p1)-1;
            while ((l >= 0 ) && (p1[l] == ' ')) {
                p1[l--] = 0;
            }

            //
            // remove heading spaces in the value
            //
            while(*p3 == ' ') {
                ++p3;
            }

            //
            // Now we have header and value
            //
            headers[headersCount][0] = p1;
            headers[headersCount][1] = p3;

            ++headersCount;
        }
        p1 = p2;
    }

finally:

    return;

}

const char* HTTPHeader::getVersion() {
    return version;
}

unsigned int HTTPHeader::getStatus() {
    return status;
}

const char* HTTPHeader::getStatusMessage() {
    return statusMessage;
}

const char* HTTPHeader::getContent() {
    return content;
}

unsigned int HTTPHeader::getHeadersCount() {
    return headersCount;
}

char** HTTPHeader::getHeader(unsigned int index) {
    if ((index < 0) || (index >= headersCount)) {
        return NULL;
    }

    return headers[index];
}

const char* HTTPHeader::getHeaderValue(const char* header) {
    char h1[DIM_HEADER], h2[DIM_HEADER];
    unsigned int j;

    strncpy(h1, header, DIM_HEADER);
    h1[DIM_HEADER-1] = 0;

    for (unsigned int i=0; i<headersCount; ++i) {
        strncpy(h2, headers[i][0], DIM_HEADER);
        h2[DIM_HEADER-1] = 0;

        //
        // We wanna do a case insensitive comparison
        //
        for (j=0; j<strlen(h1); ++j) {
            h1[j] = tolower(h1[j]);
        }
        for (j=0; j<strlen(h2); ++j) {
            h2[j] = tolower(h2[j]);
        }

        if (strcmp(h1, h2) == 0) {
            return headers[i][1];
        }
    }

    //
    // Not found
    //
    return NULL;
}

/*
 * Returns the content lenght specified with the header Content-length.
 * If the header is not found, -1 is returned.
 *
 */
int HTTPHeader::getContentLength() {
    const char *length = getHeaderValue("content-length");

    if (length == NULL) {
        return -1;
    }

    return atoi(length);
}

/*
 * Get the size in bytes of this HTTP header
 */
unsigned int HTTPHeader::getSize() {
    return size;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
老色鬼精品视频在线观看播放| 亚洲图片激情小说| 喷水一区二区三区| 91精品国产高清一区二区三区| 麻豆91免费看| 久久亚洲精精品中文字幕早川悠里| 国产一区二区三区高清播放| 中文字幕免费在线观看视频一区| 97se亚洲国产综合自在线不卡| 一区二区三区成人在线视频| 91精品一区二区三区久久久久久 | 亚洲色图制服诱惑 | 成人久久18免费网站麻豆| 中文字幕中文字幕中文字幕亚洲无线| 91亚洲精品乱码久久久久久蜜桃| 亚洲国产精品一区二区久久恐怖片| 91精品国产高清一区二区三区蜜臀 | 色综合激情五月| 男女性色大片免费观看一区二区 | 亚洲一卡二卡三卡四卡| 欧美三区免费完整视频在线观看| 日韩和欧美一区二区三区| 精品国产区一区| 99精品视频中文字幕| 日本三级韩国三级欧美三级| 国产精品久久久久7777按摩| 欧美日本一区二区三区四区| 国产精品亚洲成人| 亚洲一级片在线观看| 久久这里只有精品6| 91免费看片在线观看| 美女一区二区三区在线观看| 国产精品高清亚洲| 日韩一二三四区| 91免费看`日韩一区二区| 久久电影网站中文字幕| 亚洲品质自拍视频网站| 久久综合久色欧美综合狠狠| 欧美日韩国产综合草草| 国产成人啪免费观看软件| 亚洲妇熟xx妇色黄| 国产精品国产三级国产有无不卡 | www.亚洲在线| 久久精品国产亚洲高清剧情介绍| 国产精品久久久久久久久搜平片 | 日本aⅴ亚洲精品中文乱码| 国产精品乱子久久久久| 亚洲夂夂婷婷色拍ww47 | 久久精品视频一区二区三区| 欧美老年两性高潮| 91浏览器在线视频| 国产成人免费视频一区| 免费在线观看不卡| 亚洲高清久久久| 亚洲三级在线观看| 国产色一区二区| 久久综合狠狠综合久久激情| 91精品国产91久久久久久最新毛片| 97精品视频在线观看自产线路二 | 91同城在线观看| 国产91精品精华液一区二区三区| 久久精品国产第一区二区三区| 亚洲午夜一区二区三区| 亚洲精品免费看| 亚洲天堂久久久久久久| 亚洲国产激情av| 国产欧美日韩另类视频免费观看 | 91网站黄www| av综合在线播放| 国产超碰在线一区| 国产不卡在线一区| 国产91丝袜在线观看| 国产不卡视频一区| 成人免费视频免费观看| 粉嫩13p一区二区三区| 国产在线播放一区二区三区| 精品在线一区二区| 精品在线观看免费| 欧美在线观看一二区| 色呦呦一区二区三区| 91在线一区二区三区| 91一区二区在线观看| 91麻豆国产福利在线观看| 色综合久久久网| 欧美在线免费观看亚洲| 欧美日韩国产大片| 日韩一区二区三区电影在线观看| 日韩视频永久免费| 久久美女艺术照精彩视频福利播放 | 日本一区二区视频在线| 欧美韩国日本综合| 亚洲三级电影网站| 亚洲影视在线观看| 图片区日韩欧美亚洲| 蜜臀av一区二区在线观看| 国产麻豆精品视频| 色综合中文综合网| 久久亚洲综合av| 国产免费成人在线视频| 国产精品第四页| 亚洲成a人片在线不卡一二三区| 日韩成人午夜电影| 国产一区二区伦理| 99精品在线观看视频| 欧美男人的天堂一二区| www亚洲一区| 亚洲女同ⅹxx女同tv| 丝袜脚交一区二区| 国产一区二区按摩在线观看| 一本大道久久精品懂色aⅴ| 欧美精品久久久久久久多人混战| 久久九九国产精品| 亚洲精品水蜜桃| 蜜臂av日日欢夜夜爽一区| 国产99久久久国产精品潘金| 欧美色国产精品| 久久精品视频在线免费观看| 不卡av电影在线播放| 欧美三级视频在线播放| 精品日韩成人av| 亚洲综合色区另类av| 麻豆精品一区二区av白丝在线| 成人成人成人在线视频| 欧美日韩免费在线视频| 国产婷婷色一区二区三区四区| 亚洲图片自拍偷拍| 国产91露脸合集magnet| 7777精品伊人久久久大香线蕉 | 国产高清成人在线| 在线观看网站黄不卡| 久久午夜电影网| 亚洲成人1区2区| 99久久99久久精品免费观看| 久久综合九色综合久久久精品综合 | 欧美日韩精品是欧美日韩精品| 国产日韩三级在线| 青青草视频一区| 欧美色成人综合| 亚洲欧美日韩国产手机在线| 国产精品白丝av| 日韩免费观看2025年上映的电影| 亚洲午夜三级在线| 国产成人精品www牛牛影视| 欧美久久久久久蜜桃| 亚洲视频在线一区二区| 国产成人久久精品77777最新版本| 欧美电影影音先锋| 一区二区三区四区av| 成人夜色视频网站在线观看| 久久亚洲免费视频| 日韩和欧美一区二区三区| 91福利资源站| 亚洲人妖av一区二区| 成人avav影音| 一区在线观看视频| 成人国产精品视频| 久久精品日产第一区二区三区高清版| 免费高清不卡av| 91麻豆精品国产91久久久| 亚洲成人av电影| 在线观看91av| 天堂久久久久va久久久久| 在线看国产日韩| 亚洲午夜久久久久久久久电影网 | 一区二区视频在线| 日韩女优毛片在线| 另类小说视频一区二区| 日韩精品一区二区三区在线| 日本成人在线视频网站| 欧美高清视频不卡网| 午夜电影一区二区| 在线播放日韩导航| 日韩激情中文字幕| 日韩一区二区免费在线观看| 麻豆精品一区二区av白丝在线| 日韩一区二区在线观看视频| 麻豆精品一区二区综合av| 欧美va亚洲va| 国产成人日日夜夜| 亚洲欧美综合网| 欧美性色黄大片手机版| 婷婷夜色潮精品综合在线| 欧美一二三区在线| 国产精品亚洲综合一区在线观看| 国产精品日韩成人| 色噜噜狠狠成人网p站| 亚洲一区二区三区爽爽爽爽爽 | 久久久美女毛片| 成人免费高清视频| 亚洲精品一卡二卡| 欧美日韩在线播放三区四区| 日本欧美大码aⅴ在线播放| www久久精品| 91麻豆国产精品久久| 午夜免费久久看| 久久久精品免费观看| 99久久精品免费看国产| 亚洲二区视频在线| 亚洲精品一区二区三区蜜桃下载| av亚洲精华国产精华精华 |