mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
remove libc dependency
This commit is contained in:
parent
6c44575923
commit
765c38e7b9
@ -60,7 +60,6 @@ h2 = "0.1"
|
|||||||
fnv = "1.0.5"
|
fnv = "1.0.5"
|
||||||
http = "^0.1.5"
|
http = "^0.1.5"
|
||||||
httparse = "1.2"
|
httparse = "1.2"
|
||||||
libc = "0.2"
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
mime_guess = "2.0.0-alpha"
|
mime_guess = "2.0.0-alpha"
|
||||||
|
@ -107,7 +107,6 @@ extern crate futures_cpupool;
|
|||||||
extern crate http as modhttp;
|
extern crate http as modhttp;
|
||||||
extern crate httparse;
|
extern crate httparse;
|
||||||
extern crate language_tags;
|
extern crate language_tags;
|
||||||
extern crate libc;
|
|
||||||
extern crate mime;
|
extern crate mime;
|
||||||
extern crate mime_guess;
|
extern crate mime_guess;
|
||||||
extern crate mio;
|
extern crate mio;
|
||||||
|
@ -3,7 +3,6 @@ use std::collections::HashSet;
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::fmt::{self, Display, Formatter};
|
use std::fmt::{self, Display, Formatter};
|
||||||
|
|
||||||
use libc;
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use time;
|
use time;
|
||||||
|
|
||||||
@ -53,8 +52,6 @@ use middleware::{Finished, Middleware, Started};
|
|||||||
///
|
///
|
||||||
/// `%t` Time when the request was started to process
|
/// `%t` Time when the request was started to process
|
||||||
///
|
///
|
||||||
/// `%P` The process ID of the child that serviced the request
|
|
||||||
///
|
|
||||||
/// `%r` First line of request
|
/// `%r` First line of request
|
||||||
///
|
///
|
||||||
/// `%s` Response status code
|
/// `%s` Response status code
|
||||||
@ -181,7 +178,6 @@ impl Format {
|
|||||||
"%" => FormatText::Percent,
|
"%" => FormatText::Percent,
|
||||||
"a" => FormatText::RemoteAddr,
|
"a" => FormatText::RemoteAddr,
|
||||||
"t" => FormatText::RequestTime,
|
"t" => FormatText::RequestTime,
|
||||||
"P" => FormatText::Pid,
|
|
||||||
"r" => FormatText::RequestLine,
|
"r" => FormatText::RequestLine,
|
||||||
"s" => FormatText::ResponseStatus,
|
"s" => FormatText::ResponseStatus,
|
||||||
"b" => FormatText::ResponseSize,
|
"b" => FormatText::ResponseSize,
|
||||||
@ -205,7 +201,6 @@ impl Format {
|
|||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum FormatText {
|
pub enum FormatText {
|
||||||
Str(String),
|
Str(String),
|
||||||
Pid,
|
|
||||||
Percent,
|
Percent,
|
||||||
RequestLine,
|
RequestLine,
|
||||||
RequestTime,
|
RequestTime,
|
||||||
@ -247,7 +242,6 @@ impl FormatText {
|
|||||||
}
|
}
|
||||||
FormatText::ResponseStatus => resp.status().as_u16().fmt(fmt),
|
FormatText::ResponseStatus => resp.status().as_u16().fmt(fmt),
|
||||||
FormatText::ResponseSize => resp.response_size().fmt(fmt),
|
FormatText::ResponseSize => resp.response_size().fmt(fmt),
|
||||||
FormatText::Pid => unsafe { libc::getpid().fmt(fmt) },
|
|
||||||
FormatText::Time => {
|
FormatText::Time => {
|
||||||
let rt = time::now() - entry_time;
|
let rt = time::now() - entry_time;
|
||||||
let rt = (rt.num_nanoseconds().unwrap_or(0) as f64) / 1_000_000_000.0;
|
let rt = (rt.num_nanoseconds().unwrap_or(0) as f64) / 1_000_000_000.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user