Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
完成request和response请求的发送和接受
Browse files Browse the repository at this point in the history
存在bug。对代理的缓存没有处理。
代理返回的数据没有content-length
  • Loading branch information
kernelhcy committed Jan 10, 2011
1 parent 83f623f commit efad507
Show file tree
Hide file tree
Showing 17 changed files with 300 additions and 110 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
*.out
*.swp
*~
.deps/
.libs/
Expand Down
7 changes: 7 additions & 0 deletions autom4te.cache/output.1
Expand Up @@ -861,6 +861,7 @@ enable_fast_install
enable_dependency_tracking
with_gnu_ld
enable_libtool_lock
enable_debug
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1498,6 +1499,7 @@ Optional Features:
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-debug turn on debug

Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -11081,6 +11083,11 @@ else
fi


@%:@ Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; CFLAGS="$CFLAGS -ggdb"
fi

ac_config_headers="$ac_config_headers config.h"

for ac_header in glib.h stdarg.h
Expand Down
7 changes: 7 additions & 0 deletions autom4te.cache/output.2
Expand Up @@ -861,6 +861,7 @@ enable_fast_install
enable_dependency_tracking
with_gnu_ld
enable_libtool_lock
enable_debug
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1498,6 +1499,7 @@ Optional Features:
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-debug turn on debug

Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -11081,6 +11083,11 @@ else
fi


@%:@ Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; CFLAGS="$CFLAGS -ggdb"
fi

ac_config_headers="$ac_config_headers config.h"

for ac_header in glib.h stdarg.h
Expand Down
62 changes: 31 additions & 31 deletions autom4te.cache/traces.1
Expand Up @@ -495,43 +495,43 @@ m4trace:configure.ac:8: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
m4trace:configure.ac:8: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
m4trace:configure.ac:8: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
m4trace:configure.ac:8: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_GLIB_H], [/* Define to 1 if you have the <glib.h> header file. */
m4trace:configure.ac:10: -1- AC_CONFIG_HEADERS([config.h])
m4trace:configure.ac:11: -1- AH_OUTPUT([HAVE_GLIB_H], [/* Define to 1 if you have the <glib.h> header file. */
@%:@undef HAVE_GLIB_H])
m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STDARG_H], [/* Define to 1 if you have the <stdarg.h> header file. */
m4trace:configure.ac:11: -1- AH_OUTPUT([HAVE_STDARG_H], [/* Define to 1 if you have the <stdarg.h> header file. */
@%:@undef HAVE_STDARG_H])
m4trace:configure.ac:11: -1- AC_CONFIG_FILES([Makefile
m4trace:configure.ac:12: -1- AC_CONFIG_FILES([Makefile
src/Makefile
src/comm/Makefile
src/libqq/Makefile
src/cli/Makefile
src/gui/Makefile
src/tool/Makefile
src/test/Makefile])
m4trace:configure.ac:19: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:19: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:19: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:19: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:19: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:19: -1- AC_SUBST([am__EXEEXT_TRUE])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
m4trace:configure.ac:19: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:19: -1- AC_SUBST([am__EXEEXT_FALSE])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
m4trace:configure.ac:19: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:19: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:19: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([INSTALL])
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
m4trace:configure.ac:20: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:20: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:20: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:20: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:20: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:20: -1- AC_SUBST([am__EXEEXT_TRUE])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:20: -1- AC_SUBST([am__EXEEXT_FALSE])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([INSTALL])
m4trace:configure.ac:20: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:20: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
20 changes: 10 additions & 10 deletions autom4te.cache/traces.2
Expand Up @@ -2325,13 +2325,13 @@ m4trace:configure.ac:8: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
m4trace:configure.ac:8: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
m4trace:configure.ac:8: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
m4trace:configure.ac:8: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
m4trace:configure.ac:19: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:19: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:19: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:19: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:19: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:19: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:19: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:19: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
m4trace:configure.ac:19: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
m4trace:configure.ac:19: -1- _LT_PROG_LTMAIN
m4trace:configure.ac:20: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:20: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:20: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:20: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:20: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:20: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
m4trace:configure.ac:20: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
m4trace:configure.ac:20: -1- _LT_PROG_LTMAIN
35 changes: 21 additions & 14 deletions configure
Expand Up @@ -861,6 +861,7 @@ enable_fast_install
enable_dependency_tracking
with_gnu_ld
enable_libtool_lock
enable_debug
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1498,6 +1499,7 @@ Optional Features:
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-debug turn on debug
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -4468,13 +4470,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:4471: $ac_compile\"" >&5)
(eval echo "\"\$as_me:4473: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:4474: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:4476: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:4477: output\"" >&5)
(eval echo "\"\$as_me:4479: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
Expand Down Expand Up @@ -5680,7 +5682,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5683 "configure"' > conftest.$ac_ext
echo '#line 5685 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
Expand Down Expand Up @@ -7208,11 +7210,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7211: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7213: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7215: \$? = $ac_status" >&5
echo "$as_me:7217: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
Expand Down Expand Up @@ -7547,11 +7549,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7550: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7552: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7554: \$? = $ac_status" >&5
echo "$as_me:7556: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
Expand Down Expand Up @@ -7652,11 +7654,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7655: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7657: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7659: \$? = $ac_status" >&5
echo "$as_me:7661: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Expand Down Expand Up @@ -7707,11 +7709,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7710: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7712: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7714: \$? = $ac_status" >&5
echo "$as_me:7716: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Expand Down Expand Up @@ -10091,7 +10093,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10094 "configure"
#line 10096 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Expand Down Expand Up @@ -10187,7 +10189,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10190 "configure"
#line 10192 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Expand Down Expand Up @@ -11081,6 +11083,11 @@ else
fi


# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; CFLAGS="$CFLAGS -ggdb"
fi

ac_config_headers="$ac_config_headers config.h"

for ac_header in glib.h stdarg.h
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -6,6 +6,7 @@ CFLAGS+=`pkg-config --libs --cflags glib-2.0`
CFLAGS+='-Wall -O2'
LT_INIT(disable-static)
AC_PROG_CC
AC_ARG_ENABLE(debug, [--enable-debug turn on debug], CFLAGS="$CFLAGS -ggdb")
AC_CONFIG_HEADERS([config.h])
AC_CHECK_HEADERS([glib.h stdarg.h])
AC_CONFIG_FILES([Makefile
Expand Down
Binary file added doc/pkgs/webqqlogin_only
Binary file not shown.
File renamed without changes.
Binary file removed doc/webqq
Binary file not shown.
Empty file added src/libqq/event.c
Empty file.
8 changes: 8 additions & 0 deletions src/libqq/event.h
@@ -0,0 +1,8 @@
#ifndef __LIBWEBQQ_EVENT_H
#define __LIBWEBQQ_EVENT_H


int event_init();


#endif
9 changes: 8 additions & 1 deletion src/libqq/http.c
@@ -1,4 +1,4 @@
#include "http.h"
#include <http.h>
#include <glib/gprintf.h>

#define CRLF "\r\n"
Expand Down Expand Up @@ -375,4 +375,11 @@ void print_raw(GString* s)
g_printf("\n");
}

GString* response_get_header(Response *rp, const GString *header)
{
if(rp == NULL || header == NULL){
return NULL;
}

return (GString*)g_tree_lookup(rp -> headers, header);
}
9 changes: 6 additions & 3 deletions src/libqq/http.h
Expand Up @@ -16,7 +16,7 @@
* [ message-body ]
* Request-Line = Method SP Request-URI SP HTTP-Version CRLF
*/
typedef struct _request
typedef struct
{
GString *method;
GString *uri;
Expand All @@ -38,7 +38,7 @@ typedef struct _request
* [ message-body ] ; Section 7.2
* Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
*/
typedef struct _response
typedef struct
{
GString* version;
GString* status;
Expand Down Expand Up @@ -89,7 +89,10 @@ void response_del(Response *r);
* parse s and create a response
*/
Response* response_new_parse(GString* s);

/*
* get the value of header
*/
GString* response_get_header(Response *rp, const GString *header);
/*
* convert response to the string format
*/
Expand Down

0 comments on commit efad507

Please sign in to comment.