资源简介

http_load修改版,只支持post请求,且按顺序执行,参考https://blog.csdn.net/lala9517/article/details/79870755

资源截图

代码片段和文件信息

/* http_load - multiprocessing http test client
**
** Copyright ?1998199920012016 by Jef Poskanzer .
** All rights reserved.
**
** Redistribution and use in source and binary forms with or without
** modification are permitted provided that the following conditions
** are met:
** 1. Redistributions of source code must retain the above copyright
**    notice this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
**    notice this list of conditions and the following disclaimer in the
**    documentation and/or other materials provided with the distribution.
** 
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ‘‘AS IS‘‘ AND
** ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL
** DAMAGES (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS
** OR SERVICES; LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION)
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
** LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
** OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
*/

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#ifdef USE_SSL
#include 
#include 
#include 
#endif

#include “version.h“
#include “port.h“
#include “timers.h“

#if defined(AF_INET6) && defined(IN6_IS_ADDR_V4MAPPED)
#define USE_IPV6
#endif

#define max(ab) ((a)>=(b)?(a):(b))
#define min(ab) ((a)<=(b)?(a):(b))

/* How long a connection can stay idle before we give up on it. */
#define IDLE_SECS 60

/* Default max bytes/second in throttle mode. */
#define THROTTLE 3360

/* How often to show progress reports. */
#define PROGRESS_SECS 60

/* How many file descriptors to not use. */
#define RESERVED_FDS 3


typedef struct {
    char* url_str;
    int protocol;
    char* hostname;
    unsigned short port;
#ifdef USE_IPV6
    struct sockaddr_in6 sa_in;
#else /* USE_IPV6 */
    struct sockaddr_in sa_in;
#endif /* USE_IPV6 */
    int sa_len sock_family sock_type sock_protocol;
    char* filename;
char* filedata;
    int got_bytes;
    long bytes;
    int got_checksum;
    long checksum;
    } url;
static url* urls;
static int num_urls max_urls num_run_urls;

typedef struct {
    char* str;
    struct sockaddr_in sa_in;
    } sip;
static sip* sips;
static int num_sips max_sips;

/* Protocol symbols. */
#define PROTO_HTTP 0
#ifd

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-09 18:41  http_load_post\
     文件        6148  2018-04-09 18:41  http_load_post\.DS_Store
     目录           0  2018-04-09 18:41  __MACOSX\
     目录           0  2018-04-09 18:41  __MACOSX\http_load_post\
     文件         120  2018-04-09 18:41  __MACOSX\http_load_post\._.DS_Store
     文件          97  2018-04-04 11:15  http_load_post\FILES
     文件       24760  2018-04-09 18:30  http_load_post\http_load
     文件        5414  2018-04-04 11:15  http_load_post\http_load.1
     文件       48886  2018-04-09 18:30  http_load_post\http_load.c
     文件        1178  2018-04-04 11:15  http_load_post\make_test_files
     文件        1682  2018-04-04 11:15  http_load_post\Makefile
     文件        2504  2018-04-04 11:15  http_load_post\port.h
     文件        1035  2018-04-04 11:15  http_load_post\README
     文件        7362  2018-04-04 11:15  http_load_post\timers.c
     文件        3832  2018-04-04 11:15  http_load_post\timers.h
     文件        4760  2018-04-04 11:15  http_load_post\timers.o
     文件         163  2018-04-04 11:15  http_load_post\version.h

评论

共有 条评论