From 7cbf6068b8214a89b75e3aa26bdb10d22e97ab90 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Sun, 20 Apr 2008 22:27:11 +0000 Subject: Change uuid generaion to rely on crypto. Started crypto and inets application in startscript, and also couch_server_up. Fix for regression caused by accidental check-in of disabled etags. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@649988 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_erl_driver.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/couchdb/couch_erl_driver.c') diff --git a/src/couchdb/couch_erl_driver.c b/src/couchdb/couch_erl_driver.c index 550cff9e..c6541eaa 100644 --- a/src/couchdb/couch_erl_driver.c +++ b/src/couchdb/couch_erl_driver.c @@ -23,7 +23,6 @@ specific language governing permissions and limitations under the License. #ifndef WIN32 #include // for memcpy #endif -#include typedef struct { ErlDrvPort port; @@ -91,21 +90,11 @@ static int return_control_result(void* pLocalResult, int localLen, char **ppRetB static int couch_drv_control(ErlDrvData drv_data, unsigned int command, const char *pBuf, int bufLen, char **rbuf, int rlen) { - #define COLLATE 0 - #define COLLATE_NO_CASE 1 - #define UUID 2 couch_drv_data* pData = (couch_drv_data*)drv_data; switch(command) { - case UUID: - { - uuid_t uuid; - uuid_generate(uuid); - return return_control_result(&uuid, sizeof(uuid), rbuf, rlen); - } - - case COLLATE: - case COLLATE_NO_CASE: + case 0: // COLLATE + case 1: // COLLATE_NO_CASE: { UErrorCode status = U_ZERO_ERROR; int collResult; @@ -134,9 +123,9 @@ static int couch_drv_control(ErlDrvData drv_data, unsigned int command, const ch // point the iterator at it. uiter_setUTF8(&iterB, pBuf, length); - if (command == COLLATE) + if (command == 0) // COLLATE collResult = ucol_strcollIter(pData->coll, &iterA, &iterB, &status); - else if (command == COLLATE_NO_CASE) + else // COLLATE_NO_CASE collResult = ucol_strcollIter(pData->collNoCase, &iterA, &iterB, &status); if (collResult < 0) -- cgit v1.2.3