deflate für libfetch

Kamikaze

Warrior of Sunlight
Teammitglied
Ich habe einen vorläufigen Patch für deflate-Unterstützung in libfetch. Wäre nett, wenn ein paar Leute das testen könnten.
 

Anhänge

  • patch-libfetch.diff.txt
    5,6 KB · Aufrufe: 296
Moin Kamikaze,

ich würde es ja gern testen, aber wo brauch ich das? :) Hab die deflate-Unterstützung noch nicht vermisst.

Gruß, Elwood
 
Schnellere Datenübertragung eben. Bringt natürlich nichts beim Sourcen ziehen, die sind ja schon komprimiert, aber wenn man Textdateien über HTTP zieht dampft das den Verkehr auf 30-40% ein. Das ist natürlich eine Nischenanwendung. Aber die http.c bedarf eh vollständiger Überarbeitung.
 
Sorry, war nicht provokativ gemeint, sondern bei welcher Anwendung das zum Tragen käme (zwecks Test)... portsnap fetch?! packt die Gegenseite?!

Gruss, Elwood
 
gehoert libfetch zum basesystem?-> ok, ja ;)
habe hier aber Probleme beim Patschen: FreeBSD 6.2


Code:
pwd
/home/src/lib/libfetch
%patch -i  /tmp/patch-libfetch.diff.txt http.c
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- src/lib/libfetch/http.c.orig       2008-06-29 15:28:58.000000000 +0200
|+++ src/lib/libfetch/http.c    2008-06-30 19:38:57.000000000 +0200
--------------------------
Patching file http.c using Plan A...
Hunk #1 succeeded at 75.
Hunk #2 succeeded at 106.
Hunk #3 succeeded at 126.
Hunk #4 failed at 312.
Hunk #5 failed at 366.
Hunk #6 succeeded at 375.
Hunk #7 succeeded at 430.
Hunk #8 succeeded at 444.
Hunk #9 succeeded at 588 (offset -4 lines).
Hunk #10 succeeded at 912 (offset -2 lines).
Hunk #11 succeeded at 945 (offset -4 lines).
Hunk #12 failed at 1031.
Hunk #13 succeeded at 1114 with fuzz 2 (offset -2 lines).
Hunk #14 succeeded at 1235 (offset -4 lines).
Hunk #15 failed at 1252.
4 out of 15 hunks failed--saving rejects to http.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- src/lib/libfetch/Makefile.orig     2008-06-29 23:45:32.000000000 +0200
|+++ src/lib/libfetch/Makefile  2008-06-29 23:43:11.000000000 +0200
--------------------------
Patching file Makefile using Plan A...
Hunk #1 failed at 20.
1 out of 1 hunks failed--saving rejects to Makefile.rej
done
%cat Makefile.rej 
***************
*** 20,25 ****
  LDADD=                -lssl -lcrypto
  .endif
  
  CFLAGS+=      -DFTP_COMBINE_CWDS -l
  
  CSTD?=                c99
--- 20,27 ----
  LDADD=                -lssl -lcrypto
  .endif
  
+ LDADD+=               -lz
+ 
  CFLAGS+=      -DFTP_COMBINE_CWDS -l
  
  CSTD?=                c99
%uname -a
FreeBSD tc3 6.2-RELEASE-p9 FreeBSD 6.2-RELEASE-p9 #0: Sun Dec 30 15:41:59 MET 2007     sk@tc3:/usr/obj/home/src/sys/TC3-i386

gegen was hast du den diff geschrieben?

Gruss SK


--ok bei HEAD bekomme ich nur noch 1 Reject im Makefile.
 
Zuletzt bearbeitet:
Hallo,

Weisst du noch das exakte Datum? Habe jetzt mal alles unterhalb von /src/lib/libfetch/ geloescht und mit
Code:
 cvs up -dAP -rRELENG_7 -D '06/07/2008 23:59:07 CET'
immer noch 1 Makefile reject:

+ LDADD+= -lz


Jetzt sach nicht du hast erst um 23:59:59 cvsuped. ;)




%rm -rf libfetch
%cvs up -d -rRELENG_7 -D '06/07/2008 23:59:07 CET' libfetch && ls -dl libfetch
cvs update: Updating libfetch
U libfetch/Makefile
U libfetch/common.c
U libfetch/common.h
U libfetch/fetch.3
U libfetch/fetch.c
U libfetch/fetch.h
U libfetch/file.c
U libfetch/ftp.c
U libfetch/ftp.errors
U libfetch/http.c
U libfetch/http.errors
drwxr-xr-x 3 root wheel 512 Jul 4 19:41 libfetch
%cd libfetch/
%pwd
/home/src/lib/libfetch
%patch < /tmp/patch-libfetch.diff.txt
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- src/lib/libfetch/http.c.orig 2008-06-29 15:28:58.000000000 +0200
|+++ src/lib/libfetch/http.c 2008-06-30 19:38:57.000000000 +0200
--------------------------
Patching file http.c using Plan A...
Hunk #1 succeeded at 75.
Hunk #2 succeeded at 106.
Hunk #3 succeeded at 126.
Hunk #4 succeeded at 312.
Hunk #5 succeeded at 366.
Hunk #6 succeeded at 375.
Hunk #7 succeeded at 430.
Hunk #8 succeeded at 444.
Hunk #9 succeeded at 592.
Hunk #10 succeeded at 914.
Hunk #11 succeeded at 949.
Hunk #12 succeeded at 1035.
Hunk #13 succeeded at 1116.
Hunk #14 succeeded at 1239.
Hunk #15 succeeded at 1256.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- src/lib/libfetch/Makefile.orig 2008-06-29 23:45:32.000000000 +0200
|+++ src/lib/libfetch/Makefile 2008-06-29 23:43:11.000000000 +0200
--------------------------
Patching file Makefile using Plan A...
Hunk #1 failed at 20.
1 out of 1 hunks failed--saving rejects to Makefile.rej
done
%cat Makefile.rej
***************
wie oben.. gnarf... und irgendwie stimmt der timestamp gar nicht, da ist grad der Wurm drin.
*grummel*
 
nicht ganz :o, Der SSL und v6 Support meckert noch. Also beim Hinzfuegen der Zeile kommt:

%gmake
Makefile:3: *** missing separator. Stop.
%make
"Makefile", line 12: Malformed conditional (${MK_INET6_SUPPORT} != "no")
"Makefile", line 14: if-less endif
"Makefile", line 16: Malformed conditional (${MK_OPENSSL} != "no")
"Makefile", line 20: if-less endif
make: fatal errors encountered -- cannot continue

Ein Post des Makefiles wuerde mir ggf. weiterhelfen.



bin jetzt wieder bei der alten Syntax und siehe es kompiliert sauber durch ;)

--- Makefile 18 Jan 2008 13:23:57 -0000 1.49.2.1
+++ Makefile 4 Jul 2008 22:02:44 -0000
@@ -1,5 +1,4 @@
# $FreeBSD: src/lib/libfetch/Makefile,v 1.49.2.1 2008/01/18 13:23:57 des Exp $
-
.include <bsd.own.mk>

LIB= fetch
@@ -10,16 +9,19 @@
MAN= fetch.3
CLEANFILES= ftperr.h httperr.h

-.if ${MK_INET6_SUPPORT} != "no"
+#.if ${MK_INET6_SUPPORT} != "no"
+.if !defined(NO_INET6)
CFLAGS+= -DINET6
.endif

-.if ${MK_OPENSSL} != "no"
+#.if ${MK_OPENSSL} != "no"
+.if !defined(NO_OPENSSL)
CFLAGS+= -DWITH_SSL
DPADD= ${LIBSSL} ${LIBCRYPTO}
LDADD= -lssl -lcrypto
.endif

+LDADD+= -lz -g
CFLAGS+= -DFTP_COMBINE_CWDS

CSTD?= c99



-lz sollte doch der deflate support sein also libz:

%objdump -x libfetch.so | less

libfetch.so: file format elf32-i386-freebsd
libfetch.so
architecture: i386, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x000026d8

Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
filesz 0x0000a425 memsz 0x0000a425 flags r-x
LOAD off 0x0000a440 vaddr 0x0000b440 paddr 0x0000b440 align 2**12
filesz 0x0000080c memsz 0x000010a8 flags rw-
DYNAMIC off 0x0000a934 vaddr 0x0000b934 paddr 0x0000b934 align 2**2
filesz 0x000000c0 memsz 0x000000c0 flags rw-

Dynamic Section:
NEEDED libssl.so.4
NEEDED libcrypto.so.4
NEEDED libz.so.3
SONAME libfetch.so.5
INIT 0x1ea4
FINI 0x90ac
HASH 0x94
STRTAB 0x102c
SYMTAB 0x55c
STRSZ 0x6dd
SYMENT 0x10
PLTGOT 0xba08
PLTRELSZ 0x408
PLTREL 0x11
JMPREL 0x1a9c
REL 0x170c
RELSZ 0x390
RELENT 0x8
RELCOUNT 0x65


Gruss sk

Bah, Freitags mit tabs herumschlagen ;)
 
Zuletzt bearbeitet:
Code:
# $FreeBSD: src/lib/libfetch/Makefile,v 1.49.2.1 2008/01/18 13:23:57 des Exp $

.include <bsd.own.mk>

LIB=		fetch
CFLAGS+=	-I.
SRCS=		fetch.c common.c ftp.c http.c file.c \
		ftperr.h httperr.h
INCS=		fetch.h
MAN=		fetch.3
CLEANFILES=	ftperr.h httperr.h

.if ${MK_INET6_SUPPORT} != "no"
CFLAGS+=	-DINET6
.endif

.if ${MK_OPENSSL} != "no"
CFLAGS+=	-DWITH_SSL
DPADD=		${LIBSSL} ${LIBCRYPTO}
LDADD=		-lssl -lcrypto
.endif

LDADD+=		-lz

CFLAGS+=	-DFTP_COMBINE_CWDS -l

CSTD?=		c99
WARNS?=		2

SHLIB_MAJOR=    5

ftperr.h: ftp.errors ${.CURDIR}/Makefile
	@echo "static struct fetcherr ftp_errlist[] = {" > ${.TARGET}
	@cat ${.CURDIR}/ftp.errors \
	  | grep -v ^# \
	  | sort \
	  | while read NUM CAT STRING; do \
	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
	  done >> ${.TARGET}
	@echo "    { -1, FETCH_UNKNOWN, \"Unknown FTP error\" }" >> ${.TARGET}
	@echo "};" >> ${.TARGET}

httperr.h: http.errors ${.CURDIR}/Makefile
	@echo "static struct fetcherr http_errlist[] = {" > ${.TARGET}
	@cat ${.CURDIR}/http.errors \
	  | grep -v ^# \
	  | sort \
	  | while read NUM CAT STRING; do \
	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
	  done >> ${.TARGET}
	@echo "    { -1, FETCH_UNKNOWN, \"Unknown HTTP error\" }" >> ${.TARGET}
	@echo "};" >> ${.TARGET}

MLINKS+= fetch.3 fetchFreeURL.3
MLINKS+= fetch.3 fetchGet.3
MLINKS+= fetch.3 fetchGetFTP.3
MLINKS+= fetch.3 fetchGetFile.3
MLINKS+= fetch.3 fetchGetHTTP.3
MLINKS+= fetch.3 fetchGetURL.3
MLINKS+= fetch.3 fetchList.3
MLINKS+= fetch.3 fetchListFTP.3
MLINKS+= fetch.3 fetchListFile.3
MLINKS+= fetch.3 fetchListHTTP.3
MLINKS+= fetch.3 fetchListURL.3
MLINKS+= fetch.3 fetchMakeURL.3
MLINKS+= fetch.3 fetchParseURL.3
MLINKS+= fetch.3 fetchPut.3
MLINKS+= fetch.3 fetchPutFTP.3
MLINKS+= fetch.3 fetchPutFile.3
MLINKS+= fetch.3 fetchPutHTTP.3
MLINKS+= fetch.3 fetchPutURL.3
MLINKS+= fetch.3 fetchStat.3
MLINKS+= fetch.3 fetchStatFTP.3
MLINKS+= fetch.3 fetchStatFile.3
MLINKS+= fetch.3 fetchStatHTTP.3
MLINKS+= fetch.3 fetchStatURL.3
MLINKS+= fetch.3 fetchXGet.3
MLINKS+= fetch.3 fetchXGetFTP.3
MLINKS+= fetch.3 fetchXGetFile.3
MLINKS+= fetch.3 fetchXGetHTTP.3
MLINKS+= fetch.3 fetchXGetURL.3

.include <bsd.lib.mk>
 
Hey,

Danke :), siehe oben, ich lese jetzt erstmal fefes blog.

PS, FreeBSD Version war: 6.2-RELEASE-p9 FreeBSD 6.2-RELEASE-p9

Gruss sk
 
moin,

Das ging ja schnell! Gabs noch Feedback vom Kollegen aus Norwegen?
Hm, compress muss aber sein! Das ist so richtig oldskool :D
 
Da ich das ganze nicht nur für libfetch schreibe, kommt compress noch. Auch random-access wird es noch geben, was für libfetch natürlich gar keinen Sinn macht.

Der aktuelle Stand mit meinen Änderungen ist noch nicht wirklich Standardkonform, da der Standard verlangt, dass man mehrfach komprimierte Daten dekomprimieren kann. Das kann vor allem dann passieren, wenn ein Proxy eine stärkere Kompression noch mal drüberbügelt.
 
Zurück
Oben