[xiph-commits] r8817 - in trunk/oggdsf/src: lib/helper/libOOOggChef tools/mod_oggchef

ozone at motherfish-iii.xiph.org ozone at motherfish-iii.xiph.org
Tue Feb 1 05:13:00 PST 2005


Author: ozone
Date: 2005-02-01 05:12:56 -0800 (Tue, 01 Feb 2005)
New Revision: 8817

Modified:
   trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp
   trunk/oggdsf/src/lib/helper/libOOOggChef/utils.h
   trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp
Log:
oggdsf:
 * Make utility functions in libOOOggChef externally available
 * Warnings--
 * Oops, fix mod_oggchef so we don't do silly things if the user requested a non-existent URL on the server ...

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp	2005-02-01 03:59:18 UTC (rev 8816)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp	2005-02-01 13:12:56 UTC (rev 8817)
@@ -194,7 +194,7 @@
 }
 
 
-bool CMMLRecomposer::acceptOggPage(OggPage* inOggPage)
+bool CMMLRecomposer::acceptOggPage(OggPage*)
 {
 	return true;
 }

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/utils.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/utils.h	2005-02-01 03:59:18 UTC (rev 8816)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/utils.h	2005-02-01 13:12:56 UTC (rev 8817)
@@ -34,20 +34,25 @@
 #pragma once
 
 
+#include <libOOOggChef/libOOOggChef.h>
+
 #include <string>
 #include <vector>
 
+// TODO: Wrap this up in a static class or a namespace or something, to prevent
+// identifier clashes
+
 /// Often used by IRecomposer's subclasses' constructor, and elsewhere
 typedef bool (*BufferWriter) (unsigned char *buffer, unsigned long bufferSize, void *userData);
 
 /// Check whether the user requested only CMML in the list of MIME types
-bool wantOnlyCMML(const vector<string>* inWantedMIMETypes);
+bool LIBOOOGGCHEF_API wantOnlyCMML(const vector<string>* inWantedMIMETypes);
 
 /// Check whether we should serve out only the packet bodies given the list of MIME types
-bool wantOnlyPacketBody(const vector<string>* inWantedMIMETypes);
+bool LIBOOOGGCHEF_API wantOnlyPacketBody(const vector<string>* inWantedMIMETypes);
 
 /// a.k.a. World's most stupid stat() function
-bool fileExists(const string inFilename);
+bool LIBOOOGGCHEF_API fileExists(const string inFilename);
 
 /// Push out the entire contents of file to the inBufferWriter function
-bool sendFile(const string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData);
+bool LIBOOOGGCHEF_API sendFile(const string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData);

Modified: trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp
===================================================================
--- trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp	2005-02-01 03:59:18 UTC (rev 8816)
+++ trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp	2005-02-01 13:12:56 UTC (rev 8817)
@@ -55,6 +55,7 @@
 #include <libOOOggChef/AnnodexRecomposer.h>
 #include <libOOOggChef/CMMLRecomposer.h>
 #include <libOOOggChef/IRecomposer.h>
+#include <libOOOggChef/utils.h>
 
 #include <algorithm>
 #include <iostream>
@@ -216,6 +217,15 @@
 	}
 #endif
 
+	// Check to see if the filename exists; if it doesn't, return a 404 error.
+	// Note that we should remove this check later when e.g. we want to be able
+	// to dynamically compose an Annodex file from an existing CMML file, but
+	// since we don't do that yet, we don't have to worry about it :).
+	if (!fileExists(locFilename)) {
+		delete locOutputMIMETypes;
+		return HTTP_NOT_FOUND;
+	}
+
 	// Poor man's factory: create a new class to dynamically generate the Ogg
 	// file according to the user's wishes
 	IRecomposer *locRecomposer = NULL;



More information about the commits mailing list