Skip to content

Commit 04fda9d

Browse files
committed
Replace usage of cURL with Mongoose
1 parent d8b1769 commit 04fda9d

27 files changed

Lines changed: 29111 additions & 5820 deletions

Makefile

Lines changed: 14 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,8 @@ ifndef USE_OPENAL_DLOPEN
179179
USE_OPENAL_DLOPEN=1
180180
endif
181181

182-
ifndef USE_CURL
183-
USE_CURL=1
184-
endif
185-
186-
ifndef USE_CURL_DLOPEN
187-
ifdef MINGW
188-
USE_CURL_DLOPEN=0
189-
else
190-
USE_CURL_DLOPEN=1
191-
endif
182+
ifndef USE_MONGOOSE
183+
USE_MONGOOSE=0
192184
endif
193185

194186
ifndef USE_CODEC_VORBIS
@@ -280,6 +272,7 @@ VORBISDIR=$(MOUNT_DIR)/libvorbis-1.3.6
280272
OPUSDIR=$(MOUNT_DIR)/opus-1.2.1
281273
OPUSFILEDIR=$(MOUNT_DIR)/opusfile-0.9
282274
ZDIR=$(MOUNT_DIR)/zlib
275+
MONGOOSEDIR=$(MOUNT_DIR)/mongoose-7.18
283276
TOOLSDIR=$(MOUNT_DIR)/tools
284277
Q3ASMDIR=$(MOUNT_DIR)/tools/asm
285278
LBURGDIR=$(MOUNT_DIR)/tools/lcc/lburg
@@ -419,13 +412,6 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
419412
endif
420413
endif
421414

422-
ifeq ($(USE_CURL),1)
423-
CLIENT_CFLAGS += $(CURL_CFLAGS)
424-
ifneq ($(USE_CURL_DLOPEN),1)
425-
CLIENT_LIBS += $(CURL_LIBS)
426-
endif
427-
endif
428-
429415
ifeq ($(USE_MUMBLE),1)
430416
CLIENT_LIBS += -lrt
431417
endif
@@ -578,13 +564,6 @@ ifeq ($(PLATFORM),darwin)
578564
endif
579565
endif
580566

581-
ifeq ($(USE_CURL),1)
582-
CLIENT_CFLAGS += $(CURL_CFLAGS)
583-
ifneq ($(USE_CURL_DLOPEN),1)
584-
CLIENT_LIBS += $(CURL_LIBS)
585-
endif
586-
endif
587-
588567
BASE_CFLAGS += -D_THREAD_SAFE=1
589568

590569
CLIENT_LIBS += -framework IOKit
@@ -756,22 +735,6 @@ ifdef MINGW
756735
FREETYPE_CFLAGS = -Ifreetype2
757736
endif
758737

759-
ifeq ($(USE_CURL),1)
760-
CLIENT_CFLAGS += $(CURL_CFLAGS)
761-
ifneq ($(USE_CURL_DLOPEN),1)
762-
ifeq ($(USE_LOCAL_HEADERS),1)
763-
CLIENT_CFLAGS += -DCURL_STATICLIB
764-
ifeq ($(ARCH),x86_64)
765-
CLIENT_LIBS += $(LIBSDIR)/win64/libcurl.a -lcrypt32
766-
else
767-
CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a -lcrypt32
768-
endif
769-
else
770-
CLIENT_LIBS += $(CURL_LIBS)
771-
endif
772-
endif
773-
endif
774-
775738
ifeq ($(ARCH),x86)
776739
# build 32bit
777740
BASE_CFLAGS += -m32
@@ -847,13 +810,6 @@ ifeq ($(PLATFORM),freebsd)
847810
endif
848811
endif
849812

850-
ifeq ($(USE_CURL),1)
851-
CLIENT_CFLAGS += $(CURL_CFLAGS)
852-
ifeq ($(USE_CURL_DLOPEN),1)
853-
CLIENT_LIBS += $(CURL_LIBS)
854-
endif
855-
endif
856-
857813
# cross-compiling tweaks
858814
ifeq ($(ARCH),x86)
859815
ifeq ($(CROSS_COMPILING),1)
@@ -911,11 +867,6 @@ ifeq ($(PLATFORM),openbsd)
911867
endif
912868
endif
913869

914-
ifeq ($(USE_CURL),1)
915-
CLIENT_CFLAGS += $(CURL_CFLAGS)
916-
USE_CURL_DLOPEN=0
917-
endif
918-
919870
# no shm_open on OpenBSD
920871
USE_MUMBLE=0
921872

@@ -936,12 +887,6 @@ ifeq ($(PLATFORM),openbsd)
936887
CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS)
937888
endif
938889
endif
939-
940-
ifeq ($(USE_CURL),1)
941-
ifneq ($(USE_CURL_DLOPEN),1)
942-
CLIENT_LIBS += $(CURL_LIBS)
943-
endif
944-
endif
945890
else # ifeq openbsd
946891

947892
#############################################################################
@@ -1261,11 +1206,8 @@ ifeq ($(USE_OPENAL),1)
12611206
endif
12621207
endif
12631208

1264-
ifeq ($(USE_CURL),1)
1265-
CLIENT_CFLAGS += -DUSE_CURL
1266-
ifeq ($(USE_CURL_DLOPEN),1)
1267-
CLIENT_CFLAGS += -DUSE_CURL_DLOPEN
1268-
endif
1209+
ifeq ($(USE_MONGOOSE),1)
1210+
CLIENT_CFLAGS += -DUSE_MONGOOSE -DMG_TLS=MG_TLS_BUILTIN -DMG_ENABLE_IPV6=1 -I$(MONGOOSEDIR)
12691211
endif
12701212

12711213
ifeq ($(USE_VOIP),1)
@@ -1927,7 +1869,7 @@ Q3OBJ = \
19271869
$(B)/client/qal.o \
19281870
$(B)/client/snd_openal.o \
19291871
\
1930-
$(B)/client/cl_curl.o \
1872+
$(B)/client/cl_mongoose.o \
19311873
\
19321874
$(B)/client/sv_bot.o \
19331875
$(B)/client/sv_ccmds.o \
@@ -2375,6 +2317,11 @@ Q3OBJ += \
23752317
$(B)/client/zutil.o
23762318
endif
23772319

2320+
ifeq ($(USE_MONGOOSE),1)
2321+
Q3OBJ += \
2322+
$(B)/client/mongoose.o
2323+
endif
2324+
23782325
ifeq ($(HAVE_VM_COMPILED),true)
23792326
ifneq ($(findstring $(ARCH),x86 x86_64),)
23802327
Q3OBJ += \
@@ -2924,6 +2871,9 @@ $(B)/client/%.o: $(OPUSFILEDIR)/src/%.c
29242871
$(B)/client/%.o: $(ZDIR)/%.c
29252872
$(DO_CC)
29262873

2874+
$(B)/client/%.o: $(MONGOOSEDIR)/%.c
2875+
$(DO_CC)
2876+
29272877
$(B)/client/%.o: $(SDLDIR)/%.c
29282878
$(DO_CC)
29292879

@@ -3210,7 +3160,6 @@ ifdef MINGW
32103160
SDLDLL=$(SDLDLL) \
32113161
USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \
32123162
USE_OPENAL_DLOPEN=$(USE_OPENAL_DLOPEN) \
3213-
USE_CURL_DLOPEN=$(USE_CURL_DLOPEN) \
32143163
USE_INTERNAL_OPUS=$(USE_INTERNAL_OPUS) \
32153164
USE_INTERNAL_ZLIB=$(USE_INTERNAL_ZLIB) \
32163165
USE_INTERNAL_JPEG=$(USE_INTERNAL_JPEG)

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Some of the major features currently implemented are:
2727
* Much improved QVM tools
2828
* Support for various esoteric operating systems
2929
* cl_guid support
30-
* HTTP/FTP download redirection (using cURL)
30+
* HTTP download redirection
3131
* Multiuser support on Windows systems (user specific game data
3232
is stored in "%APPDATA%\Quake3")
3333
* PNG support
@@ -154,8 +154,7 @@ Makefile.local:
154154
MISSIONPACK_CFLAGS - custom CFLAGS for missionpack (default '-DMISSIONPACK')
155155
USE_OPENAL - use OpenAL where available
156156
USE_OPENAL_DLOPEN - link with OpenAL at runtime
157-
USE_CURL - use libcurl for http/ftp download support
158-
USE_CURL_DLOPEN - link with libcurl at runtime
157+
USE_MONGOOSE - use mongoose for http download support
159158
USE_CODEC_VORBIS - enable Ogg Vorbis support
160159
USE_CODEC_OPUS - enable Ogg Opus support
161160
USE_MUMBLE - enable Mumble support
@@ -208,7 +207,6 @@ set using command line arguments:
208207
cl_aviFrameRate - the framerate to use when capturing video
209208
cl_aviMotionJpeg - use the mjpeg codec when capturing video
210209
cl_guidServerUniq - makes cl_guid unique for each server
211-
cl_cURLLib - filename of cURL library to load
212210
cl_consoleKeys - space delimited list of key names or
213211
characters that toggle the console
214212
cl_mouseAccelStyle - Set to 1 for QuakeLive mouse acceleration

0 commit comments

Comments
 (0)