⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jni.c

📁 解压在c盘
💻 C
字号:
/* * Copyright (c) 1999-2000 Caucho Technology.  All rights reserved. * * Caucho Technology permits redistribution, modification and use * of this file in source and binary form ("the Software") under the * Caucho Public License ("the License").  In particular, the following * conditions must be met: * * 1. Each copy or derived work of the Software must preserve the copyright *    notice and this notice unmodified. * * 2. Redistributions of the Software in source or binary form must include  *    an unmodified copy of the License, normally in a plain ASCII text * * 3. The names "Resin" or "Caucho" are trademarks of Caucho Technology and *    may not be used to endorse products derived from this software. *    "Resin" or "Caucho" may not appear in the names of products derived *    from this software. * * 4. Caucho Technology requests that attribution be given to Resin *    in any manner possible.  We suggest using the "Resin Powered" *    button or creating a "powered by Resin(tm)" link to *    http://www.caucho.com for each page served by Resin. * * This Software is provided "AS IS," without a warranty of any kind.  * ALL EXPRESS OR IMPLIED REPRESENTATIONS AND WARRANTIES, INCLUDING ANY * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * CAUCHO TECHNOLOGY AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE OR ANY THIRD PARTY AS A RESULT OF USING OR * DISTRIBUTING SOFTWARE. IN NO EVENT WILL Caucho OR ITS LICENSORS BE LIABLE * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR * INABILITY TO USE SOFTWARE, EVEN IF HE HAS BEEN ADVISED OF THE POSSIBILITY * OF SUCH DAMAGES.       */#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <fcntl.h>#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <jni.h>#include "cse.h"#include "proxy.h"voidcse_log(char *fmt, ...){}void *cse_create_lock(){  return 0;}void *cse_malloc(int size){  return malloc(size);}intcse_lock(void *lock){  return 1;}voidcse_unlock(void *lock){}voidcse_error(config_t *config, char *format, ...){}void cse_free(config_t *config, void *data) {}voidcse_set_socket_cleanup(int socket, void *pool){}voidcse_kill_socket_cleanup(int socket, void *pool){}static voidjni_request_parse(JNIEnv *env, jobject obj, request_t *request, int sock){  }voidJava_com_caucho_server_http_JniRequest_doRequest(JNIEnv *env,                                                 jobject obj,                                                 jint ss){  request_t *request = request_create();  response_t *res = response_create();  struct sockaddr_in sin;  int len = sizeof(sin);  char buf[4096];      int sock;      memset(&sin, 0, sizeof(&sin));      sock = accept(ss, (struct sockaddr *) &sin, &len);  if (sock < 0) {    close(ss); // XXX: other possibilities    return;  }  response_start(res, sock);    jni_request_parse(env, obj, request, sock);  cse_rprintf(res, "hello\n");  cse_flush_request(res);  close(sock);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -